From 46e34143a267699c227a29e988de741546a071e0 Mon Sep 17 00:00:00 2001 From: "Heero.Law" Date: Tue, 25 Dec 2018 11:38:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist-cmd/pubsub/1.2/pubsub-debug.js | 16 ++++++++-------- dist-cmd/pubsub/1.2/pubsub.js | 2 +- dist-npm/package.json | 2 +- dist-npm/pubsub/1.2/pubsub.js | 16 ++++++++-------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/dist-cmd/pubsub/1.2/pubsub-debug.js b/dist-cmd/pubsub/1.2/pubsub-debug.js index c8bb567..4123123 100644 --- a/dist-cmd/pubsub/1.2/pubsub-debug.js +++ b/dist-cmd/pubsub/1.2/pubsub-debug.js @@ -20,14 +20,6 @@ var EventArg = require('./event-arg'); module.exports = function(handlers) { var __eventHandlers = {}; - if (handlers) { - for (var e in handlers) { - if (handlers.hasOwnProperty(e) && handlers[e]) { - this.on(e, handlers[e]); - } - } - } - /** * 触发事件。 * @method trigger @@ -95,6 +87,14 @@ module.exports = function(handlers) { return this; }; + + if (handlers) { + for (var e in handlers) { + if (handlers.hasOwnProperty(e) && handlers[e]) { + this.on(e, handlers[e]); + } + } + } }; }); \ No newline at end of file diff --git a/dist-cmd/pubsub/1.2/pubsub.js b/dist-cmd/pubsub/1.2/pubsub.js index ec75487..97fc7ab 100644 --- a/dist-cmd/pubsub/1.2/pubsub.js +++ b/dist-cmd/pubsub/1.2/pubsub.js @@ -1,2 +1,2 @@ define("pubsub/1.2/event-arg",null,function(t,e,n){"use strict";var i=t("../../base/1.2/base");function a(){return!1}function o(){return!0}n.exports=i.createClass(function(t,e){var n=this;i.extend(n,e),n.type=t,n.timeStamp=+new Date},{preventDefault:function(){this.isDefaultPrevented=o},stopPropagation:function(){this.isPropagationStopped=o},isDefaultPrevented:a,isPropagationStopped:a})}); -define("pubsub/1.2/pubsub",["base/1.2/base"],function(e,t,r){"use strict";var f=e("./event-arg");r.exports=function(e){var a={};if(e)for(var t in e)e.hasOwnProperty(t)&&e[t]&&this.on(t,e[t]);this.trigger=function(e,t,r){var n=new f(e,t),i=a[e];if(i)for(var s=0;s