Commit 954d8602 authored by Julia Radzhabova's avatar Julia Radzhabova

Resize plugins panel.

parent 8501cf59
......@@ -172,6 +172,11 @@ define([
}, this);
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() {
......@@ -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.initx = e.pageX - parseInt(e.currentTarget.style.left);
}
Common.NotificationCenter.trigger('layout:resizestart');
},
resizeMove: function(e) {
......@@ -331,6 +337,7 @@ define([
this.doLayout();
this.trigger('layout:resizedrag', this);
}
Common.NotificationCenter.trigger('layout:resizestop');
},
freezePanels: function (value) {
......
......@@ -74,6 +74,8 @@ define([
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_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;
},
......@@ -88,6 +90,19 @@ define([
onAfterRender: function(panelPlugins) {
panelPlugins.viewPluginsList.on('item:click', _.bind(this.onSelectPlugin, this));
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() {
......@@ -249,6 +264,14 @@ define([
onToolClose: function() {
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 || {}));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment