[SSE] Move sheet: drag and drop

This commit is contained in:
Julia Svinareva 2020-02-25 12:05:23 +03:00
parent ecdd310efd
commit 2f223cfb5e
2 changed files with 5 additions and 1 deletions

View file

@ -240,6 +240,9 @@ define([
lockDrag = true; lockDrag = true;
} }
}); });
if (this.bar.selectTabs.length === this.bar.tabs.length || this.bar.tabs.length === 1) {
lockDrag = true;
}
this.bar.$el.find('ul > li > span').attr('draggable', !lockDrag); this.bar.$el.find('ul > li > span').attr('draggable', !lockDrag);
tab.changeState(); tab.changeState();
} else { } else {

View file

@ -202,6 +202,7 @@ define([
}, this), }, this),
'tab:dragstart': _.bind(function (dataTransfer, selectTabs) { 'tab:dragstart': _.bind(function (dataTransfer, selectTabs) {
this.api.asc_closeCellEditor();
var arrTabs = [], var arrTabs = [],
arrName = [], arrName = [],
me = this; me = this;
@ -238,7 +239,7 @@ define([
var data = dataTransfer.getData("onlyoffice"); var data = dataTransfer.getData("onlyoffice");
if (data) { if (data) {
var arrData = JSON.parse(data); var arrData = JSON.parse(data);
if (arrData[0].type === 'onlyoffice') { if (arrData) {
var key = _.findWhere(arrData, {type: 'key'}).value; var key = _.findWhere(arrData, {type: 'key'}).value;
if (Common.Utils.InternalSettings.get("sse-doc-info-key") === key) { if (Common.Utils.InternalSettings.get("sse-doc-info-key") === key) {
this.api.asc_moveWorksheet(index, _.findWhere(arrData, {type: 'indexes'}).value); this.api.asc_moveWorksheet(index, _.findWhere(arrData, {type: 'indexes'}).value);