[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_onError', _.bind(this.onError, this));
this.api.asc_registerCallback('asc_onFilterInfo', _.bind(this.onApiFilterInfo , 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_onActiveSheetChanged', _.bind(this.onApiActiveSheetChanged, this));
this.api.asc_registerCallback('asc_onRefreshNamedSheetViewList', _.bind(this.onRefreshNamedSheetViewList, this)); this.api.asc_registerCallback('asc_onRefreshNamedSheetViewList', _.bind(this.onRefreshNamedSheetViewList, this));
this.statusbar.setApi(api); this.statusbar.setApi(api);
@ -710,12 +709,16 @@ define([
onApiActiveSheetChanged: function (index) { onApiActiveSheetChanged: function (index) {
this.statusbar.tabMenu.hide(); 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() { onRefreshNamedSheetViewList: function() {
var views = this.api.asc_getNamedSheetViews(), var views = this.api.asc_getNamedSheetViews(),
active = false, active = false,
name=""; name="",
me = this;
for (var i=0; i<views.length; i++) { for (var i=0; i<views.length; i++) {
if (views[i].asc_getIsActive()) { if (views[i].asc_getIsActive()) {
active = true; 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")) { 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); if (!this._sheetViewTip) {
var tip = new Common.UI.SynchronizeTip({ this._sheetViewTip = new Common.UI.SynchronizeTip({
target : $('#editor_sdk'), target : $('#editor_sdk'),
extCls : 'no-arrow', extCls : 'no-arrow',
text : this.textSheetViewTip, text : this.textSheetViewTip,
placement : 'target' placement : 'target'
}); });
tip.on({ this._sheetViewTip.on({
'dontshowclick': function() { 'dontshowclick': function() {
Common.localStorage.setBool("sse-hide-sheet-view-tip", true); Common.localStorage.setBool("sse-hide-sheet-view-tip", true);
this.close(); Common.Utils.InternalSettings.set("sse-hide-sheet-view-tip", true);
}, this.close();
'closeclick': function() { me._sheetViewTip = undefined;
this.close(); },
} 'closeclick': function() {
}); Common.Utils.InternalSettings.set("sse-hide-sheet-view-tip", true);
tip.show(); 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}%', zoomText : 'Zoom {0}%',