Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8f19c47c

Von Sven Schöling vor fast 8 Jahren hinzugefügt

  • ID 8f19c47cfbccd1f40739aa5cb8ea22b2697c0e5e
  • Vorgänger 426a5bf3
  • Nachfolger 506a2aab

kivi.Part.js: run_action als wrapper um functions und strings

Unterschiede anzeigen:

js/kivi.Part.js
384 384
        success: function (data) {
385 385
          if (data.length == 1) {
386 386
            self.set_item(data[0]);
387
            if (callbacks && callbacks.match_one) callbacks.match_one(data[0]);
387
            if (callbacks && callbacks.match_one) self.run_action(callbacks.match_one, [ data[0] ]);
388 388
          } else if (data.length > 1) {
389 389
            self.state = self.STATES.UNDEFINED;
390
            if (callbacks && callbacks.match_many) callbacks.match_many(data);
390
            if (callbacks && callbacks.match_many) self.run_action(callbacks.match_many, [ data ]);
391 391
          } else {
392 392
            self.state = self.STATES.UNDEFINED;
393
            if (callbacks && callbacks.match_none) callbacks.match_none();
393
            if (callbacks && callbacks.match_none) self.run_action(callbacks.match_none);
394 394
          }
395 395
          self.annotate_state();
396 396
        }
......
480 480
      var popup_button = $('<span>').addClass('ppp_popup_button');
481 481
      this.$dummy.after(popup_button);
482 482
      popup_button.click(function() { self.open_dialog() });
483
    },
484
    run_action: function(code, args) {
485
      if (typeof code === 'function')
486
        code.apply(this, args)
487
      else
488
        kivi.run(code, args);
483 489
    }
484 490
  };
485 491
  ns.Picker.prototype.STATES = {

Auch abrufbar als: Unified diff