Resize plugins panel.
This commit is contained in:
parent
8501cf59b0
commit
954d86022e
|
@ -172,6 +172,11 @@ define([
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
this.freeze = options.freeze; this.freeze && this.freezePanels(this.freeze);
|
this.freeze = options.freeze; this.freeze && this.freezePanels(this.freeze);
|
||||||
|
|
||||||
|
Common.NotificationCenter.on({
|
||||||
|
'frame:mouseMove': this.resize.eventMove,
|
||||||
|
'frame:mouseup': this.resize.eventStop
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
doLayout: function() {
|
doLayout: function() {
|
||||||
|
@ -251,6 +256,7 @@ define([
|
||||||
this.resize.max = (panel.maxpos > 0 ? panel.maxpos : this.resize.$el.parent().height() + panel.maxpos) - this.resize.width;
|
this.resize.max = (panel.maxpos > 0 ? panel.maxpos : this.resize.$el.parent().height() + panel.maxpos) - this.resize.width;
|
||||||
this.resize.initx = e.pageX - parseInt(e.currentTarget.style.left);
|
this.resize.initx = e.pageX - parseInt(e.currentTarget.style.left);
|
||||||
}
|
}
|
||||||
|
Common.NotificationCenter.trigger('layout:resizestart');
|
||||||
},
|
},
|
||||||
|
|
||||||
resizeMove: function(e) {
|
resizeMove: function(e) {
|
||||||
|
@ -331,6 +337,7 @@ define([
|
||||||
this.doLayout();
|
this.doLayout();
|
||||||
this.trigger('layout:resizedrag', this);
|
this.trigger('layout:resizedrag', this);
|
||||||
}
|
}
|
||||||
|
Common.NotificationCenter.trigger('layout:resizestop');
|
||||||
},
|
},
|
||||||
|
|
||||||
freezePanels: function (value) {
|
freezePanels: function (value) {
|
||||||
|
|
|
@ -74,6 +74,8 @@ define([
|
||||||
this.api.asc_registerCallback("asc_onPluginShow", _.bind(this.onPluginShow, this));
|
this.api.asc_registerCallback("asc_onPluginShow", _.bind(this.onPluginShow, this));
|
||||||
this.api.asc_registerCallback("asc_onPluginClose", _.bind(this.onPluginClose, this));
|
this.api.asc_registerCallback("asc_onPluginClose", _.bind(this.onPluginClose, this));
|
||||||
this.api.asc_registerCallback("asc_onPluginResize", _.bind(this.onPluginResize, this));
|
this.api.asc_registerCallback("asc_onPluginResize", _.bind(this.onPluginResize, this));
|
||||||
|
this.api.asc_registerCallback("asc_onPluginMouseUp", _.bind(this.onPluginMouseUp, this));
|
||||||
|
this.api.asc_registerCallback("asc_onPluginMouseMove", _.bind(this.onPluginMouseMove, this));
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
@ -88,6 +90,19 @@ define([
|
||||||
onAfterRender: function(panelPlugins) {
|
onAfterRender: function(panelPlugins) {
|
||||||
panelPlugins.viewPluginsList.on('item:click', _.bind(this.onSelectPlugin, this));
|
panelPlugins.viewPluginsList.on('item:click', _.bind(this.onSelectPlugin, this));
|
||||||
this.bindViewEvents(this.panelPlugins, this.events);
|
this.bindViewEvents(this.panelPlugins, this.events);
|
||||||
|
var me = this;
|
||||||
|
Common.NotificationCenter.on({
|
||||||
|
'layout:resizestart': function(e){
|
||||||
|
if (me.panelPlugins.isVisible()) {
|
||||||
|
me.api.asc_pluginEnableMouseEvents(true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'layout:resizestop': function(e){
|
||||||
|
if (me.panelPlugins.isVisible()) {
|
||||||
|
me.api.asc_pluginEnableMouseEvents(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
updatePluginsList: function() {
|
updatePluginsList: function() {
|
||||||
|
@ -249,6 +264,14 @@ define([
|
||||||
|
|
||||||
onToolClose: function() {
|
onToolClose: function() {
|
||||||
this.api.asc_pluginButtonClick(-1);
|
this.api.asc_pluginButtonClick(-1);
|
||||||
|
},
|
||||||
|
|
||||||
|
onPluginMouseUp: function(e) {
|
||||||
|
Common.NotificationCenter.trigger('frame:mouseup', e);
|
||||||
|
},
|
||||||
|
|
||||||
|
onPluginMouseMove: function(e) {
|
||||||
|
Common.NotificationCenter.trigger('frame:mousemove', e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, Common.Controllers.Plugins || {}));
|
}, Common.Controllers.Plugins || {}));
|
||||||
|
|
Loading…
Reference in a new issue