Commit 6369c32b authored by Julia Radzhabova's avatar Julia Radzhabova

Bug 32194.

parent 20ef76ed
...@@ -76,6 +76,7 @@ define([ ...@@ -76,6 +76,7 @@ define([
this.handler = _options.handler; this.handler = _options.handler;
this.toggleGroup = _options.toggleGroup; this.toggleGroup = _options.toggleGroup;
this.contentWidth = _options.contentWidth; this.contentWidth = _options.contentWidth;
this.storageName = _options.storageName;
Common.UI.Window.prototype.initialize.call(this, _options); Common.UI.Window.prototype.initialize.call(this, _options);
}, },
...@@ -143,6 +144,37 @@ define([ ...@@ -143,6 +144,37 @@ define([
return false; return false;
}, },
setActiveCategory: function(index) {
if (this.btnsCategory.length<1) return;
var btnActive = this.btnsCategory[(index>=0 && index<this.btnsCategory.length) ? index : 0];
if (!btnActive.isVisible() || btnActive.isDisabled()) {
for (var i = 0; i<this.btnsCategory.length; i++){
var btn = this.btnsCategory[i];
if (btn.isVisible() && !btn.isDisabled()) {
btnActive = btn;
break;
}
}
}
btnActive.toggle(true);
this.onCategoryClick(btnActive);
},
getActiveCategory: function() {
var index = -1;
this.btnsCategory.forEach(function(btn, idx){
if (btn.pressed) index = idx;
});
return index;
},
close: function(suppressevent) {
if (this.storageName)
Common.localStorage.setItem(this.storageName, this.getActiveCategory());
Common.UI.Window.prototype.close.call(this, suppressevent);
},
cancelButtonText: 'Cancel', cancelButtonText: 'Cancel',
okButtonText : 'Ok' okButtonText : 'Ok'
}, Common.Views.AdvancedSettingsWindow || {})); }, Common.Views.AdvancedSettingsWindow || {}));
......
...@@ -61,7 +61,8 @@ define([ ...@@ -61,7 +61,8 @@ define([
options: { options: {
contentWidth: 320, contentWidth: 320,
height : 380, height : 380,
toggleGroup : 'dropcap-adv-settings-group' toggleGroup : 'dropcap-adv-settings-group',
storageName: 'de-dropcap-settings-adv-category'
}, },
initialize : function(options) { initialize : function(options) {
...@@ -742,26 +743,13 @@ define([ ...@@ -742,26 +743,13 @@ define([
this._UpdateTableBordersStyle(ct, border, size, color, this.Borders); this._UpdateTableBordersStyle(ct, border, size, color, this.Borders);
}, this); }, this);
var btnCategoryFrame, btnCategoryDropcap; if (this.isFrame)
_.each(this.btnsCategory, function(btn) {
if (btn.options.contentTarget == 'id-adv-dropcap-frame')
btnCategoryFrame = btn;
else if(btn.options.contentTarget == 'id-adv-dropcap-dropcap')
btnCategoryDropcap = btn;
});
this.content_panels.filter('.active').removeClass('active');
if (!this.isFrame) {
btnCategoryFrame.hide();
btnCategoryDropcap.toggle(true, true);
$("#" + btnCategoryDropcap.options.contentTarget).addClass('active');
} else {
btnCategoryDropcap.hide();
btnCategoryFrame.toggle(true, true);
$("#" + btnCategoryFrame.options.contentTarget).addClass('active');
this.setHeight(500); this.setHeight(500);
this.btnsCategory[(this.isFrame) ? 1 : 0].setVisible(false);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
} }
}, },
......
...@@ -54,7 +54,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat ...@@ -54,7 +54,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
toggleGroup: 'image-adv-settings-group', toggleGroup: 'image-adv-settings-group',
sizeOriginal: {width: 0, height: 0}, sizeOriginal: {width: 0, height: 0},
sizeMax: {width: 55.88, height: 55.88}, sizeMax: {width: 55.88, height: 55.88},
properties: null properties: null,
storageName: 'de-img-settings-adv-category'
}, },
initialize : function(options) { initialize : function(options) {
...@@ -62,7 +63,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat ...@@ -62,7 +63,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
title: this.textTitle, title: this.textTitle,
items: [ items: [
{panelId: 'id-adv-image-width', panelCaption: this.textSize}, {panelId: 'id-adv-image-width', panelCaption: this.textSize},
{panelId: 'id-adv-shape-size', panelCaption: this.textSize}, {panelId: 'id-adv-shape-size', panelCaption: this.textSize},
{panelId: 'id-adv-image-wrap', panelCaption: this.textBtnWrap}, {panelId: 'id-adv-image-wrap', panelCaption: this.textBtnWrap},
{panelId: 'id-adv-image-position', panelCaption: this.textPosition}, {panelId: 'id-adv-image-position', panelCaption: this.textPosition},
{panelId: 'id-adv-image-shape', panelCaption: this.textShape}, {panelId: 'id-adv-image-shape', panelCaption: this.textShape},
...@@ -1067,25 +1068,10 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat ...@@ -1067,25 +1068,10 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
afterRender: function() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);
this.btnsCategory[(this._objectType == Asc.c_oAscTypeSelectElement.Shape) ? 0 : 1].setVisible(false);
var btnCategoryShapeSize, btnCategoryImageSize; if (this.storageName) {
_.each(this.btnsCategory, function(btn) { var value = Common.localStorage.getItem(this.storageName);
if (btn.options.contentTarget == 'id-adv-image-width') this.setActiveCategory((value!==null) ? parseInt(value) : 0);
btnCategoryImageSize = btn;
else if(btn.options.contentTarget == 'id-adv-shape-size')
btnCategoryShapeSize = btn;
});
this.content_panels.filter('.active').removeClass('active');
if (this._objectType == Asc.c_oAscTypeSelectElement.Shape) {
btnCategoryImageSize.hide();
btnCategoryShapeSize.toggle(true, true);
$("#" + btnCategoryShapeSize.options.contentTarget).addClass('active');
} else {
btnCategoryShapeSize.hide();
btnCategoryImageSize.toggle(true, true);
$("#" + btnCategoryImageSize.options.contentTarget).addClass('active');
} }
}, },
......
...@@ -54,7 +54,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem ...@@ -54,7 +54,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
options: { options: {
contentWidth: 325, contentWidth: 325,
height: 394, height: 394,
toggleGroup: 'paragraph-adv-settings-group' toggleGroup: 'paragraph-adv-settings-group',
storageName: 'de-para-settings-adv-category'
}, },
initialize : function(options) { initialize : function(options) {
...@@ -768,6 +769,11 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem ...@@ -768,6 +769,11 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
} }
this._UpdateTableBordersStyle(ct, border, size, color, this.Borders); this._UpdateTableBordersStyle(ct, border, size, color, this.Borders);
}, this); }, this);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
}, },
onStrikeChange: function(field, newValue, oldValue, eOpts){ onStrikeChange: function(field, newValue, oldValue, eOpts){
......
...@@ -55,7 +55,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat ...@@ -55,7 +55,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
options: { options: {
contentWidth: 340, contentWidth: 340,
height: 436, height: 436,
toggleGroup: 'table-adv-settings-group' toggleGroup: 'table-adv-settings-group',
storageName: 'de-table-settings-adv-category'
}, },
initialize : function(options) { initialize : function(options) {
...@@ -1133,6 +1134,11 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat ...@@ -1133,6 +1134,11 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
} }
this._UpdateTableBordersStyle(ct, border, size, color, (this._allTable) ? this.TableBorders : this.CellBorders, (this._allTable) ? this.ChangedTableBorders : this.ChangedCellBorders); this._UpdateTableBordersStyle(ct, border, size, color, (this._allTable) ? this.TableBorders : this.CellBorders, (this._allTable) ? this.ChangedTableBorders : this.ChangedCellBorders);
}, this); }, this);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
}, },
getSettings: function() { getSettings: function() {
......
...@@ -50,7 +50,8 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem ...@@ -50,7 +50,8 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem
contentWidth: 340, contentWidth: 340,
height: 235, height: 235,
sizeOriginal: {width: 0, height: 0}, sizeOriginal: {width: 0, height: 0},
sizeMax: {width: 55.88, height: 55.88} sizeMax: {width: 55.88, height: 55.88},
storageName: 'pe-img-settings-adv-category'
}, },
initialize : function(options) { initialize : function(options) {
...@@ -183,6 +184,10 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem ...@@ -183,6 +184,10 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem
afterRender: function() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
}, },
_setDefaults: function(props) { _setDefaults: function(props) {
......
...@@ -51,7 +51,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced ...@@ -51,7 +51,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
options: { options: {
contentWidth: 320, contentWidth: 320,
height: 394, height: 394,
toggleGroup: 'paragraph-adv-settings-group' toggleGroup: 'paragraph-adv-settings-group',
storageName: 'pe-para-settings-adv-category'
}, },
initialize : function(options) { initialize : function(options) {
...@@ -370,6 +371,10 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced ...@@ -370,6 +371,10 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
afterRender: function() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
}, },
onStrikeChange: function(field, newValue, oldValue, eOpts){ onStrikeChange: function(field, newValue, oldValue, eOpts){
......
...@@ -52,7 +52,8 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem ...@@ -52,7 +52,8 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
toggleGroup: 'shape-adv-settings-group', toggleGroup: 'shape-adv-settings-group',
sizeOriginal: {width: 0, height: 0}, sizeOriginal: {width: 0, height: 0},
sizeMax: {width: 55.88, height: 55.88}, sizeMax: {width: 55.88, height: 55.88},
properties: null properties: null,
storageName: 'pe-shape-settings-adv-category'
}, },
initialize : function(options) { initialize : function(options) {
...@@ -412,6 +413,10 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem ...@@ -412,6 +413,10 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
afterRender: function() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
}, },
_setDefaults: function(props) { _setDefaults: function(props) {
......
...@@ -48,7 +48,8 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem ...@@ -48,7 +48,8 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
options: { options: {
alias: 'TableSettingsAdvanced', alias: 'TableSettingsAdvanced',
contentWidth: 280, contentWidth: 280,
height: 385 height: 385,
storageName: 'pe-table-settings-adv-category'
}, },
initialize : function(options) { initialize : function(options) {
...@@ -304,6 +305,10 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem ...@@ -304,6 +305,10 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
afterRender: function() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
}, },
getSettings: function() { getSettings: function() {
......
...@@ -50,7 +50,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' ...@@ -50,7 +50,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
options: { options: {
contentWidth: 322, contentWidth: 322,
height: 535, height: 535,
toggleGroup: 'chart-settings-dlg-group' toggleGroup: 'chart-settings-dlg-group',
storageName: 'sse-chart-settings-adv-category'
}, },
initialize : function(options) { initialize : function(options) {
...@@ -806,6 +807,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' ...@@ -806,6 +807,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.updateChartStyles(this.api.asc_getChartPreviews(this._state.ChartType)); this.updateChartStyles(this.api.asc_getChartPreviews(this._state.ChartType));
this._setDefaults(this.chartSettings); this._setDefaults(this.chartSettings);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
}, },
onSelectType: function(btn, picker, itemView, record) { onSelectType: function(btn, picker, itemView, record) {
...@@ -1148,8 +1153,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' ...@@ -1148,8 +1153,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
} else } else
this.txtDataRange.showError([this.txtEmpty]); this.txtDataRange.showError([this.txtEmpty]);
this.btnsCategory[0].toggle(true); this.setActiveCategory(0);
this.onCategoryClick(this.btnsCategory[0]);
if (isvalid == Asc.c_oAscError.ID.StockChartError) { if (isvalid == Asc.c_oAscError.ID.StockChartError) {
Common.UI.warning({msg: this.errorStockChart}); Common.UI.warning({msg: this.errorStockChart});
} else if (isvalid == Asc.c_oAscError.ID.MaxDataSeriesError) { } else if (isvalid == Asc.c_oAscError.ID.MaxDataSeriesError) {
......
...@@ -51,7 +51,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced. ...@@ -51,7 +51,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
options: { options: {
contentWidth: 320, contentWidth: 320,
height: 394, height: 394,
toggleGroup: 'paragraph-adv-settings-group' toggleGroup: 'paragraph-adv-settings-group',
storageName: 'sse-para-settings-adv-category'
}, },
initialize : function(options) { initialize : function(options) {
...@@ -369,6 +370,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced. ...@@ -369,6 +370,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
afterRender: function() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
}, },
onStrikeChange: function(field, newValue, oldValue, eOpts){ onStrikeChange: function(field, newValue, oldValue, eOpts){
......
...@@ -52,7 +52,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp ...@@ -52,7 +52,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp
toggleGroup: 'shape-adv-settings-group', toggleGroup: 'shape-adv-settings-group',
sizeOriginal: {width: 0, height: 0}, sizeOriginal: {width: 0, height: 0},
sizeMax: {width: 55.88, height: 55.88}, sizeMax: {width: 55.88, height: 55.88},
properties: null properties: null,
storageName: 'sse-shape-settings-adv-category'
}, },
initialize : function(options) { initialize : function(options) {
...@@ -436,6 +437,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp ...@@ -436,6 +437,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp
afterRender: function() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
}, },
_setDefaults: function(props) { _setDefaults: function(props) {
......
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