Skip to content

Commit

Permalink
Merge pull request kindsoft#176 from laoshu133/bug_fix
Browse files Browse the repository at this point in the history
Bug fix
  • Loading branch information
luolonghao committed Feb 28, 2015
2 parents e66d57e + a5aa39e commit cd5335f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ KEditor.prototype = {
},
loadPlugin : function(name, fn) {
var self = this;
var _pluginStatus = this._pluginStatus;
if (!_pluginStatus) {
_pluginStatus = this._pluginStatus = {};
}

if (_plugins[name]) {
// JS加载中,等待JS加载完成
if (!_isFunction(_plugins[name])) {
Expand All @@ -379,8 +384,13 @@ KEditor.prototype = {
}, 100);
return self;
}
// JS加载完成
_plugins[name].call(self, KindEditor);

// JS加载完成,避免初始化多次
if(!_pluginStatus[name]) {
_plugins[name].call(self, KindEditor);
_pluginStatus[name] = 'inited';
}

if (fn) {
fn.call(self);
}
Expand Down
5 changes: 5 additions & 0 deletions src/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ function _drag(options) {
}

clickEl.mousedown(function(e) {
// 不响应右键,否则可能导致点选右键菜单时无法取消拖拽
if(e.button !== 0 && e.button !== 1) {
return;
}

e.stopPropagation();

var self = clickEl.get(),
Expand Down

0 comments on commit cd5335f

Please sign in to comment.