[DE] Page thumbnails: add handlers
This commit is contained in:
parent
6da800f8c0
commit
c89bc87017
|
@ -167,6 +167,7 @@ define([
|
|||
this.leftMenu.getMenu('file').setApi(api);
|
||||
if (this.mode.canUseHistory)
|
||||
this.getApplication().getController('Common.Controllers.History').setApi(this.api).setMode(this.mode);
|
||||
this.getApplication().getController('PageThumbnails').setApi(this.api).setMode(this.mode);
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
@ -52,6 +52,10 @@ define([
|
|||
],
|
||||
|
||||
initialize: function() {
|
||||
this._sendUndoPoint = true;
|
||||
this.addListeners({
|
||||
'PageThumbnails': {}
|
||||
});
|
||||
},
|
||||
|
||||
events: function() {
|
||||
|
@ -75,6 +79,43 @@ define([
|
|||
},
|
||||
|
||||
onAfterRender: function(panelThumbnails) {
|
||||
panelThumbnails.sldrThumbnailsSize.on('change', _.bind(this.onChangeSize, this));
|
||||
panelThumbnails.sldrThumbnailsSize.on('changecomplete', _.bind(this.onSizeChangeComplete, this));
|
||||
|
||||
panelThumbnails.buttonSettings.menu.on('item:click', this.onHighlightVisiblePart.bind(this));
|
||||
},
|
||||
|
||||
onHighlightVisiblePart: function(menu, item, e) {
|
||||
if (item.value === 'highlight') {
|
||||
//console.log(item.isChecked());
|
||||
}
|
||||
},
|
||||
|
||||
onChangeSize: function(field, newValue) {
|
||||
this._sliderSizeChanged = newValue;
|
||||
|
||||
if (this._sendUndoPoint) {
|
||||
this.api.setStartPointHistory();
|
||||
this._sendUndoPoint = false;
|
||||
this.updateslider = setInterval(_.bind(this._sizeApplyFunc, this), 100);
|
||||
}
|
||||
},
|
||||
|
||||
onSizeChangeComplete: function(field, newValue){
|
||||
clearInterval(this.updateslider);
|
||||
this._sliderChanged = newValue;
|
||||
if (!this._sendUndoPoint) { // start point was added
|
||||
this.api.setEndPointHistory();
|
||||
this._sizeApplyFunc();
|
||||
}
|
||||
this._sendUndoPoint = true;
|
||||
},
|
||||
|
||||
_sizeApplyFunc: function() {
|
||||
if (this._sliderChanged!==undefined) {
|
||||
// apply this._sliderChanged
|
||||
this._sliderChanged = undefined;
|
||||
}
|
||||
},
|
||||
|
||||
}, DE.Controllers.PageThumbnails || {}));
|
||||
|
|
|
@ -109,6 +109,7 @@ define([
|
|||
{
|
||||
caption: this.textHighlightVisiblePart,
|
||||
checkable: true,
|
||||
value: 'highlight',
|
||||
toggleGroup: 'menuThumbnails'
|
||||
}
|
||||
]
|
||||
|
@ -116,7 +117,7 @@ define([
|
|||
});
|
||||
}
|
||||
|
||||
this.sldrthumbnailsSize = new Common.UI.SingleSlider({
|
||||
this.sldrThumbnailsSize = new Common.UI.SingleSlider({
|
||||
el: $('#sld-thumbnails-size'),
|
||||
width: 120,
|
||||
minValue: 0,
|
||||
|
|
Loading…
Reference in a new issue