[PE] Fix header/footer

This commit is contained in:
Julia Radzhabova 2019-07-15 10:35:30 +03:00
parent 954322e3e0
commit 2ce5d74d57
2 changed files with 25 additions and 9 deletions

View file

@ -234,18 +234,17 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template',
item.setDisabled(!val);
});
var lang = this.lang,
format;
var format,
datetime = slideprops.get_DateTime(),
item = this.cmbLang.store.findWhere({value: datetime.get_Lang() || this.lang});
this._originalLang = item ? item.get('value') : 0x0409;
this.cmbLang.setValue(this._originalLang);
if (val) {
var datetime = slideprops.get_DateTime();
lang = datetime.get_Lang() || this.lang;
format = datetime.get_DateTime();
this.chUpdate.setValue(!!format, true);
!format && (format = datetime.get_CustomDateTime());
}
var item = this.cmbLang.store.findWhere({value: lang});
item = item ? item.get('value') : 0x0409;
this.cmbLang.setValue(item);
this.updateFormats(this.cmbLang.getValue(), format);
val = slideprops.get_ShowSlideNum();
@ -294,7 +293,20 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template',
},
_handleInput: function(state) {
this.handler && this.handler.call(this, state, this.getSettings());
if (this.handler) {
if (state == 'ok') {
if (this.cmbLang.getValue() !== this._originalLang) {
Common.UI.warning({
title: this.notcriticalErrorTitle,
maxwidth: 600,
msg : this.diffLanguage
});
return;
}
}
this.handler.call(this, state, this.getSettings());
}
this.close();
},
@ -309,7 +321,9 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template',
textSlideNum: 'Slide number',
textFooter: 'Text in footer',
textNotTitle: 'Don\'t show on title slide',
textPreview: 'Preview'
textPreview: 'Preview',
diffLanguage: 'You cant use a date format in a different language than the slide master.\nTo change the master, click \'Apply to all\' instead of \'Apply\'',
notcriticalErrorTitle: 'Warning'
}, PE.Views.HeaderFooterDialog || {}))
});

View file

@ -1237,6 +1237,8 @@
"PE.Views.HeaderFooterDialog.textFooter": "Text in footer",
"PE.Views.HeaderFooterDialog.textNotTitle": "Don't show on title slide",
"PE.Views.HeaderFooterDialog.textPreview": "Preview",
"PE.Views.HeaderFooterDialog.diffLanguage": "You cant use a date format in a different language than the slide master.<br>To change the master, click 'Apply to all' instead of 'Apply'",
"PE.Views.HeaderFooterDialog.notcriticalErrorTitle": "Warning",
"PE.Views.HyperlinkSettingsDialog.cancelButtonText": "Cancel",
"PE.Views.HyperlinkSettingsDialog.okButtonText": "OK",
"PE.Views.HyperlinkSettingsDialog.strDisplay": "Display",