[SSE] Fix sheet view mode tip

This commit is contained in:
Julia Radzhabova 2020-07-17 18:38:38 +03:00
parent 323d50ef4c
commit 1854345961

View file

@ -104,7 +104,6 @@ define([
this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this));
this.api.asc_registerCallback('asc_onFilterInfo', _.bind(this.onApiFilterInfo , this));
this.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(this.onApiActiveSheetChanged, this));
this.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(this.onApiActiveSheetChanged, this));
this.api.asc_registerCallback('asc_onRefreshNamedSheetViewList', _.bind(this.onRefreshNamedSheetViewList, this));
this.statusbar.setApi(api);
@ -710,12 +709,16 @@ define([
onApiActiveSheetChanged: function (index) {
this.statusbar.tabMenu.hide();
if (this._sheetViewTip && this._sheetViewTip.isVisible() && !this.api.asc_getActiveNamedSheetView(index)) { // hide tip when sheet in the default mode
this._sheetViewTip.hide();
}
},
onRefreshNamedSheetViewList: function() {
var views = this.api.asc_getNamedSheetViews(),
active = false,
name="";
name="",
me = this;
for (var i=0; i<views.length; i++) {
if (views[i].asc_getIsActive()) {
active = true;
@ -729,24 +732,31 @@ define([
}
if (active && !Common.localStorage.getBool("sse-hide-sheet-view-tip") && !Common.Utils.InternalSettings.get("sse-hide-sheet-view-tip")) {
Common.Utils.InternalSettings.set("sse-hide-sheet-view-tip", true);
var tip = new Common.UI.SynchronizeTip({
target : $('#editor_sdk'),
extCls : 'no-arrow',
text : this.textSheetViewTip,
placement : 'target'
});
tip.on({
'dontshowclick': function() {
Common.localStorage.setBool("sse-hide-sheet-view-tip", true);
this.close();
},
'closeclick': function() {
this.close();
}
});
tip.show();
}
if (!this._sheetViewTip) {
this._sheetViewTip = new Common.UI.SynchronizeTip({
target : $('#editor_sdk'),
extCls : 'no-arrow',
text : this.textSheetViewTip,
placement : 'target'
});
this._sheetViewTip.on({
'dontshowclick': function() {
Common.localStorage.setBool("sse-hide-sheet-view-tip", true);
Common.Utils.InternalSettings.set("sse-hide-sheet-view-tip", true);
this.close();
me._sheetViewTip = undefined;
},
'closeclick': function() {
Common.Utils.InternalSettings.set("sse-hide-sheet-view-tip", true);
this.close();
me._sheetViewTip = undefined;
}
});
}
if (!this._sheetViewTip.isVisible())
this._sheetViewTip.show();
} else if (!active && this._sheetViewTip && this._sheetViewTip.isVisible())
this._sheetViewTip.hide();
},
zoomText : 'Zoom {0}%',