[DE] Fix resize in Page Thumbnails
This commit is contained in:
parent
58d4bb70db
commit
836acf1698
|
@ -56,7 +56,12 @@ define([
|
||||||
this.firstShow = true;
|
this.firstShow = true;
|
||||||
this.addListeners({
|
this.addListeners({
|
||||||
'PageThumbnails': {
|
'PageThumbnails': {
|
||||||
'show': _.bind(this.onAfterShow, this)
|
'show': _.bind(function () {
|
||||||
|
if (this.firstShow) {
|
||||||
|
this.api.asc_viewerThumbnailsResize();
|
||||||
|
this.firstShow = false;
|
||||||
|
}
|
||||||
|
}, this)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -65,9 +70,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
this.panelThumbnails = this.createView('PageThumbnails', /*{
|
this.panelThumbnails = this.createView('PageThumbnails');
|
||||||
storeThumbnails: this.getApplication().getCollection('Thumbnails')
|
|
||||||
}*/);
|
|
||||||
this.panelThumbnails.on('render:after', _.bind(this.onAfterRender, this));
|
this.panelThumbnails.on('render:after', _.bind(this.onAfterRender, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -84,21 +87,19 @@ define([
|
||||||
|
|
||||||
onAfterRender: function(panelThumbnails) {
|
onAfterRender: function(panelThumbnails) {
|
||||||
panelThumbnails.sldrThumbnailsSize.on('change', _.bind(this.onChangeSize, this));
|
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));
|
panelThumbnails.buttonSettings.menu.on('item:click', _.bind(this.onHighlightVisiblePart, this));
|
||||||
},
|
panelThumbnails.buttonSettings.menu.on('show:before', _.bind(function () {
|
||||||
|
this.panelThumbnails.sldrThumbnailsSize.setValue(this.thumbnailsSize);
|
||||||
|
}, this));
|
||||||
|
|
||||||
onAfterShow: function() {
|
|
||||||
this.panelThumbnails.sldrThumbnailsSize.setValue(this.thumbnailsSize * 100);
|
var viewport = DE.getController('Viewport').getView('Viewport');
|
||||||
if (this.firstShow) {
|
viewport.hlayout.on('layout:resizedrag', _.bind(function () {
|
||||||
this.api.asc_setViewerThumbnailsZoom(this.thumbnailsSize);
|
if (!this.firstShow) {
|
||||||
this.firstShow = false;
|
this.api.asc_viewerThumbnailsResize();
|
||||||
}
|
}
|
||||||
},
|
}, this));
|
||||||
|
|
||||||
updateSize: function (size) {
|
|
||||||
this.thumbnailsSize = size;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onHighlightVisiblePart: function(menu, item, e) {
|
onHighlightVisiblePart: function(menu, item, e) {
|
||||||
|
@ -107,8 +108,13 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateSize: function (size) {
|
||||||
|
this.thumbnailsSize = size * 100;
|
||||||
|
},
|
||||||
|
|
||||||
onChangeSize: function(field, newValue) {
|
onChangeSize: function(field, newValue) {
|
||||||
if (newValue!==undefined) {
|
if (newValue!==undefined) {
|
||||||
|
this.thumbnailsSize = newValue;
|
||||||
this.api.asc_setViewerThumbnailsZoom(newValue / 100);
|
this.api.asc_setViewerThumbnailsZoom(newValue / 100);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue