[PE] Fix Bug 36519.
This commit is contained in:
parent
3544988c73
commit
fda9051a91
|
@ -46,6 +46,13 @@ define([
|
||||||
PE.Collections = PE.Collections || {};
|
PE.Collections = PE.Collections || {};
|
||||||
|
|
||||||
PE.Collections.SlideLayouts = Backbone.Collection.extend({
|
PE.Collections.SlideLayouts = Backbone.Collection.extend({
|
||||||
model: PE.Models.SlideLayout
|
model: PE.Models.SlideLayout,
|
||||||
|
|
||||||
|
findLayoutByIndex: function(index) {
|
||||||
|
return this.find(
|
||||||
|
function(model){
|
||||||
|
return model.get('data').idx == index;
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -635,7 +635,8 @@ define([
|
||||||
no_text = true,
|
no_text = true,
|
||||||
no_object = true,
|
no_object = true,
|
||||||
in_equation = false,
|
in_equation = false,
|
||||||
in_chart = false;
|
in_chart = false,
|
||||||
|
layout_index = -1;
|
||||||
|
|
||||||
while (++i < selectedObjects.length) {
|
while (++i < selectedObjects.length) {
|
||||||
type = selectedObjects[i].get_ObjectType();
|
type = selectedObjects[i].get_ObjectType();
|
||||||
|
@ -647,6 +648,7 @@ define([
|
||||||
} else if (type == Asc.c_oAscTypeSelectElement.Slide) {
|
} else if (type == Asc.c_oAscTypeSelectElement.Slide) {
|
||||||
slide_deleted = pr.get_LockDelete();
|
slide_deleted = pr.get_LockDelete();
|
||||||
slide_layout_lock = pr.get_LockLayout();
|
slide_layout_lock = pr.get_LockLayout();
|
||||||
|
layout_index = pr.get_LayoutIndex();
|
||||||
} else if (type == Asc.c_oAscTypeSelectElement.Image || type == Asc.c_oAscTypeSelectElement.Shape || type == Asc.c_oAscTypeSelectElement.Chart || type == Asc.c_oAscTypeSelectElement.Table) {
|
} else if (type == Asc.c_oAscTypeSelectElement.Image || type == Asc.c_oAscTypeSelectElement.Shape || type == Asc.c_oAscTypeSelectElement.Chart || type == Asc.c_oAscTypeSelectElement.Table) {
|
||||||
shape_locked = pr.get_Locked();
|
shape_locked = pr.get_Locked();
|
||||||
no_object = false;
|
no_object = false;
|
||||||
|
@ -704,6 +706,9 @@ define([
|
||||||
if (this._state.activated) this._state.in_equation = in_equation;
|
if (this._state.activated) this._state.in_equation = in_equation;
|
||||||
this.toolbar.lockToolbar(PE.enumLock.inEquation, in_equation, {array: [me.toolbar.btnSuperscript, me.toolbar.btnSubscript]});
|
this.toolbar.lockToolbar(PE.enumLock.inEquation, in_equation, {array: [me.toolbar.btnSuperscript, me.toolbar.btnSubscript]});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.toolbar.mnuChangeSlidePicker)
|
||||||
|
this.toolbar.mnuChangeSlidePicker.options.layout_index = layout_index;
|
||||||
},
|
},
|
||||||
|
|
||||||
onApiStyleChange: function(v) {
|
onApiStyleChange: function(v) {
|
||||||
|
|
|
@ -1913,6 +1913,7 @@ define([
|
||||||
lockedDeleted = elValue.get_LockRemove();
|
lockedDeleted = elValue.get_LockRemove();
|
||||||
lockedLayout = elValue.get_LockLayout();
|
lockedLayout = elValue.get_LockLayout();
|
||||||
menuSlideSettings.options.value = element;
|
menuSlideSettings.options.value = element;
|
||||||
|
me.slideLayoutMenu.options.layout_index = elValue.get_LayoutIndex();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1974,8 +1975,6 @@ define([
|
||||||
me.slideLayoutMenu = new Common.UI.DataView({
|
me.slideLayoutMenu = new Common.UI.DataView({
|
||||||
el : $('#id-docholder-menu-changeslide'),
|
el : $('#id-docholder-menu-changeslide'),
|
||||||
parentMenu : mnuChangeSlide.menu,
|
parentMenu : mnuChangeSlide.menu,
|
||||||
showLast: false,
|
|
||||||
// restoreHeight: 300,
|
|
||||||
style: 'max-height: 300px;',
|
style: 'max-height: 300px;',
|
||||||
store : PE.getCollection('SlideLayouts'),
|
store : PE.getCollection('SlideLayouts'),
|
||||||
itemTemplate: _.template([
|
itemTemplate: _.template([
|
||||||
|
@ -1998,7 +1997,12 @@ define([
|
||||||
mnuChangeSlide.menu.on('show:after', function (menu) {
|
mnuChangeSlide.menu.on('show:after', function (menu) {
|
||||||
me.onSlidePickerShowAfter(me.slideLayoutMenu);
|
me.onSlidePickerShowAfter(me.slideLayoutMenu);
|
||||||
me.slideLayoutMenu.scroller.update({alwaysVisibleY: true});
|
me.slideLayoutMenu.scroller.update({alwaysVisibleY: true});
|
||||||
me.slideLayoutMenu.scroller.scrollTop(0);
|
|
||||||
|
var record = me.slideLayoutMenu.store.findLayoutByIndex(me.slideLayoutMenu.options.layout_index);
|
||||||
|
if (record) {
|
||||||
|
me.slideLayoutMenu.selectRecord(record, true);
|
||||||
|
me.slideLayoutMenu.scrollToRecord(record);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
me.slideLayoutMenu._needRecalcSlideLayout = true;
|
me.slideLayoutMenu._needRecalcSlideLayout = true;
|
||||||
|
|
|
@ -1338,7 +1338,6 @@ define([
|
||||||
me.mnuChangeSlidePicker = new Common.UI.DataView({
|
me.mnuChangeSlidePicker = new Common.UI.DataView({
|
||||||
el: $('#id-toolbar-menu-changeslide'),
|
el: $('#id-toolbar-menu-changeslide'),
|
||||||
parentMenu: me.btnChangeSlide.menu,
|
parentMenu: me.btnChangeSlide.menu,
|
||||||
showLast: false,
|
|
||||||
restoreHeight: 300,
|
restoreHeight: 300,
|
||||||
style: 'max-height: 300px;',
|
style: 'max-height: 300px;',
|
||||||
store: PE.getCollection('SlideLayouts'),
|
store: PE.getCollection('SlideLayouts'),
|
||||||
|
@ -1353,7 +1352,12 @@ define([
|
||||||
me.btnChangeSlide.menu.on('show:after', function () {
|
me.btnChangeSlide.menu.on('show:after', function () {
|
||||||
me.onSlidePickerShowAfter(me.mnuChangeSlidePicker);
|
me.onSlidePickerShowAfter(me.mnuChangeSlidePicker);
|
||||||
me.mnuChangeSlidePicker.scroller.update({alwaysVisibleY: true});
|
me.mnuChangeSlidePicker.scroller.update({alwaysVisibleY: true});
|
||||||
me.mnuChangeSlidePicker.scroller.scrollTop(0);
|
|
||||||
|
var record = me.mnuChangeSlidePicker.store.findLayoutByIndex(me.mnuChangeSlidePicker.options.layout_index);
|
||||||
|
if (record) {
|
||||||
|
me.mnuChangeSlidePicker.selectRecord(record, true);
|
||||||
|
me.mnuChangeSlidePicker.scrollToRecord(record);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
me.mnuChangeSlidePicker._needRecalcSlideLayout = true;
|
me.mnuChangeSlidePicker._needRecalcSlideLayout = true;
|
||||||
|
|
Loading…
Reference in a new issue