Selaa lähdekoodia

modding[#1697]: Added a client-side event that fires after a UI is rendered and changed the uiBase.on helper to include the fired event object when calling the handler

tags/v0.8.6^2
Shaun 3 vuotta sitten
vanhempi
commit
7b4e9bf360
1 muutettua tiedostoa jossa 6 lisäystä ja 5 poistoa
  1. +6
    -5
      src/client/ui/uiBase.js

+ 6
- 5
src/client/ui/uiBase.js Näytä tiedosto

@@ -48,6 +48,10 @@ define([
this.registerUiEvents();

this.shown = this.el.is(':visible');

events.emit('onAfterRenderUi', {
ui: this
});
},

registerUiEvents: function () {
@@ -69,11 +73,8 @@ define([
else
el = $(el);

el.on(eventName, function () {
let args = [].slice.call(arguments, 1);
args.splice(0, 0, eventName);

callback.apply(null, args);
el.on(eventName, function (e) {
callback(e, eventName);
});
},



Ladataan…
Peruuta
Tallenna