diff --git a/apps/common/main/lib/component/MenuItem.js b/apps/common/main/lib/component/MenuItem.js index c0f7c99fd..6b81c41f4 100644 --- a/apps/common/main/lib/component/MenuItem.js +++ b/apps/common/main/lib/component/MenuItem.js @@ -135,6 +135,7 @@ define([ this.toggleGroup = me.options.toggleGroup; this.template = me.options.template || this.template; this.iconCls = me.options.iconCls; + this.hint = me.options.hint; this.rendered = false; if (this.menu !== null && !(this.menu instanceof Common.UI.Menu)) { @@ -189,6 +190,14 @@ define([ } } + if (me.options.hint) { + el.attr('data-toggle', 'tooltip'); + el.tooltip({ + title : me.options.hint, + placement : me.options.hintAnchor||'cursor' + }); + } + if (this.disabled) $(this.el).toggleClass('disabled', this.disabled); diff --git a/apps/common/main/lib/controller/ExternalDiagramEditor.js b/apps/common/main/lib/controller/ExternalDiagramEditor.js index 9373a4e2d..df8e41e32 100644 --- a/apps/common/main/lib/controller/ExternalDiagramEditor.js +++ b/apps/common/main/lib/controller/ExternalDiagramEditor.js @@ -51,7 +51,8 @@ define([ var appLang = 'en', customization = undefined, targetApp = '', - externalEditor = null; + externalEditor = null, + isAppFirstOpened = true; var createExternalEditor = function() { @@ -106,6 +107,11 @@ define([ if (externalEditor) { externalEditor.serviceCommand('setAppDisabled',false); + if (isAppFirstOpened && this.diagramEditorView._isExternalDocReady) { + isAppFirstOpened = false; + this.diagramEditorView._chartData && this.setChartData(); + } + if (this.needDisableEditing && this.diagramEditorView._isExternalDocReady) { this.onDiagrammEditingDisabled(); } @@ -150,8 +156,10 @@ define([ }, setChartData: function() { - externalEditor && externalEditor.serviceCommand('setChartData', this.diagramEditorView._chartData); - this.diagramEditorView._chartData = null; + if (!isAppFirstOpened) { + externalEditor && externalEditor.serviceCommand('setChartData', this.diagramEditorView._chartData); + this.diagramEditorView._chartData = null; + } }, loadConfig: function(data) { @@ -190,10 +198,8 @@ define([ if (this.diagramEditorView) { if (eventData.type == 'documentReady') { this.diagramEditorView._isExternalDocReady = true; - if (this.diagramEditorView._chartData) { - externalEditor && externalEditor.serviceCommand('setChartData', this.diagramEditorView._chartData); - this.diagramEditorView._chartData = null; - } + this.isExternalEditorVisible && (isAppFirstOpened = false); + this.diagramEditorView._chartData && this.setChartData(); if (this.needDisableEditing) { this.onDiagrammEditingDisabled(); } diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 66593ab3f..ae2a5cbac 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -604,7 +604,7 @@ define([ this.view.btnsDocLang && this.view.btnsDocLang.forEach(function(button) { if ( button ) { - button.setDisabled(disable || this.langs.length<1); + button.setDisabled(disable || !this.langs || this.langs.length<1); } }, this); } diff --git a/apps/common/main/lib/extend/Bootstrap.js b/apps/common/main/lib/extend/Bootstrap.js index c83f5f5da..a69a8e174 100755 --- a/apps/common/main/lib/extend/Bootstrap.js +++ b/apps/common/main/lib/extend/Bootstrap.js @@ -165,13 +165,25 @@ function patchDropDownKeyDownAdditional(e) { // only for formula menu when typin if (!$items.length) return; - var index = $items.index($items.filter('.focus')); + var index = $items.index($items.filter('.focus')), + previndex = index; if (e.keyCode == 38) { index > 0 ? index-- : ($this.hasClass('no-cyclic') ? (index = 0) : (index = $items.length - 1));} else // up if (e.keyCode == 40) { index < $items.length - 1 ? index++ : ($this.hasClass('no-cyclic') ? (index = $items.length - 1) : (index = 0));} // down if (!~index) index=0; $items.removeClass('focus'); $items.eq(index).addClass('focus'); + + if (previndex !== index) { + var tip = $items.eq(previndex).parent().data('bs.tooltip'); + if (tip) { + tip.hide(); + } + tip = $items.eq(index).parent().data('bs.tooltip'); + if (tip) { + tip.show(); + } + } } function getParent($this) { diff --git a/apps/common/main/lib/view/AdvancedSettingsWindow.js b/apps/common/main/lib/view/AdvancedSettingsWindow.js index c794ebdee..c269de6e4 100644 --- a/apps/common/main/lib/view/AdvancedSettingsWindow.js +++ b/apps/common/main/lib/view/AdvancedSettingsWindow.js @@ -110,6 +110,22 @@ define([ this.content_panels = $window.find('.settings-panel'); if (this.btnsCategory.length>0) this.btnsCategory[0].toggle(true, true); + + me.menuAddAlign = function(menuRoot, left, top) { + var self = this; + if (!$window.hasClass('notransform')) { + $window.addClass('notransform'); + menuRoot.addClass('hidden'); + setTimeout(function() { + menuRoot.removeClass('hidden'); + menuRoot.css({left: left, top: top}); + self.options.additionalAlign = null; + }, 300); + } else { + menuRoot.css({left: left, top: top}); + self.options.additionalAlign = null; + } + } }, setHeight: function(height) { diff --git a/apps/common/main/lib/view/LanguageDialog.js b/apps/common/main/lib/view/LanguageDialog.js index ceef1ed51..ec068553f 100644 --- a/apps/common/main/lib/view/LanguageDialog.js +++ b/apps/common/main/lib/view/LanguageDialog.js @@ -95,7 +95,7 @@ define([ '