diff --git a/apps/common/main/lib/component/ComboDataView.js b/apps/common/main/lib/component/ComboDataView.js index 7edb86952..d3a1f3bd0 100644 --- a/apps/common/main/lib/component/ComboDataView.js +++ b/apps/common/main/lib/component/ComboDataView.js @@ -91,6 +91,7 @@ define([ this.rendered = false; this.needFillComboView = false; this.minWidth = this.options.minWidth; + this.delayRenderTips = this.options.delayRenderTips || false; this.fieldPicker = new Common.UI.DataView({ cls: 'field-picker', @@ -102,7 +103,8 @@ define([ '<%= title %>', '<% } %>', '' - ].join('')) + ].join('')), + delayRenderTips: this.delayRenderTips }); this.openButton = new Common.UI.Button({ @@ -137,7 +139,8 @@ define([ '<%= title %>', '<% } %>', '' - ].join('')) + ].join('')), + delayRenderTips: this.delayRenderTips }); // Handle resize diff --git a/apps/common/main/lib/component/DataView.js b/apps/common/main/lib/component/DataView.js index 1fc31a77f..76f887b5a 100644 --- a/apps/common/main/lib/component/DataView.js +++ b/apps/common/main/lib/component/DataView.js @@ -272,6 +272,7 @@ define([ me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true; me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false; me.tabindex = me.options.tabindex || 0; + me.delayRenderTips = me.options.delayRenderTips || false; if (me.parentMenu) me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0); me.rendered = false; @@ -454,14 +455,28 @@ define([ var idx = _.indexOf(this.store.models, record); this.dataViewItems = this.dataViewItems.slice(0, idx).concat(view).concat(this.dataViewItems.slice(idx)); - if (record.get('tip')) { - var view_el = $(view.el); - view_el.attr('data-toggle', 'tooltip'); - view_el.tooltip({ - title : record.get('tip'), - placement : 'cursor', - zIndex : this.tipZIndex - }); + var me = this, + view_el = $(view.el), + tip = record.get('tip'); + if (tip) { + if (this.delayRenderTips) + view_el.one('mouseenter', function(){ // hide tooltip when mouse is over menu + view_el.attr('data-toggle', 'tooltip'); + view_el.tooltip({ + title : tip, + placement : 'cursor', + zIndex : me.tipZIndex + }); + view_el.mouseenter(); + }); + else { + view_el.attr('data-toggle', 'tooltip'); + view_el.tooltip({ + title : tip, + placement : 'cursor', + zIndex : me.tipZIndex + }); + } } this.listenTo(view, 'change', this.onChangeItem); diff --git a/apps/documenteditor/main/app/view/ChartSettings.js b/apps/documenteditor/main/app/view/ChartSettings.js index 04d71b17a..1470e4092 100644 --- a/apps/documenteditor/main/app/view/ChartSettings.js +++ b/apps/documenteditor/main/app/view/ChartSettings.js @@ -235,7 +235,8 @@ define([ cls: 'combo-chart-style', dataHint: '1', dataHintDirection: 'bottom', - dataHintOffset: 'big' + dataHintOffset: 'big', + delayRenderTips: true }); this.cmbWrapType.menuPicker.itemTemplate = this.cmbWrapType.fieldPicker.itemTemplate = _.template([ '
', @@ -274,7 +275,8 @@ define([ restoreHeight: 465, groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getChartGroupData()), store: new Common.UI.DataViewStore(Common.define.chartData.getChartData()), - itemTemplate: _.template('
\">
') + itemTemplate: _.template('
\">
'), + delayRenderTips: true }); }); this.btnChartType.render($('#chart-button-type')); @@ -444,7 +446,8 @@ define([ cls: 'combo-chart-style', dataHint: '1', dataHintDirection: 'bottom', - dataHintOffset: 'big' + dataHintOffset: 'big', + delayRenderTips: true }); this.cmbChartStyle.render($('#chart-combo-style')); this.cmbChartStyle.openButton.menu.cmpEl.css({ diff --git a/apps/documenteditor/main/app/view/ImageSettings.js b/apps/documenteditor/main/app/view/ImageSettings.js index 9cc3c39cf..86e1bb314 100644 --- a/apps/documenteditor/main/app/view/ImageSettings.js +++ b/apps/documenteditor/main/app/view/ImageSettings.js @@ -139,7 +139,8 @@ define([ cls: 'combo-chart-style', dataHint: '1', dataHintDirection: 'bottom', - dataHintOffset: '-10, 0' + dataHintOffset: '-10, 0', + delayRenderTips: true }); this.cmbWrapType.menuPicker.itemTemplate = this.cmbWrapType.fieldPicker.itemTemplate = _.template([ '
', diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index 6bd98fb15..93232f5d2 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -1586,7 +1586,8 @@ define([ cls: 'combo-chart-style', dataHint: '1', dataHintDirection: 'bottom', - dataHintOffset: 'big' + dataHintOffset: 'big', + delayRenderTips: true }); this.cmbWrapType.menuPicker.itemTemplate = this.cmbWrapType.fieldPicker.itemTemplate = _.template([ '
', diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js index 5341bc33a..ccef63270 100644 --- a/apps/documenteditor/main/app/view/TableSettings.js +++ b/apps/documenteditor/main/app/view/TableSettings.js @@ -754,7 +754,8 @@ define([ groups: new Common.UI.DataViewGroupStore(), store: new Common.UI.DataViewStore(), itemTemplate: _.template('
'), - style: 'max-height: 350px;' + style: 'max-height: 350px;', + delayRenderTips: true }); }); this.btnTableTemplate.render($('#table-btn-template')); diff --git a/apps/presentationeditor/main/app/view/ChartSettings.js b/apps/presentationeditor/main/app/view/ChartSettings.js index 92a70dff9..9ac998a65 100644 --- a/apps/presentationeditor/main/app/view/ChartSettings.js +++ b/apps/presentationeditor/main/app/view/ChartSettings.js @@ -226,7 +226,8 @@ define([ restoreHeight: 465, groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getChartGroupData()), store: new Common.UI.DataViewStore(Common.define.chartData.getChartData()), - itemTemplate: _.template('
\">
') + itemTemplate: _.template('
\">
'), + delayRenderTips: true }); }); this.btnChartType.render($('#chart-button-type')); @@ -386,7 +387,8 @@ define([ cls: 'combo-chart-style', dataHint: '1', dataHintDirection: 'bottom', - dataHintOffset: 'big' + dataHintOffset: 'big', + delayRenderTips: true }); this.cmbChartStyle.render($('#chart-combo-style')); this.cmbChartStyle.openButton.menu.cmpEl.css({ diff --git a/apps/presentationeditor/main/app/view/TableSettings.js b/apps/presentationeditor/main/app/view/TableSettings.js index de77ea633..56ffc1f02 100644 --- a/apps/presentationeditor/main/app/view/TableSettings.js +++ b/apps/presentationeditor/main/app/view/TableSettings.js @@ -695,7 +695,8 @@ define([ groups: new Common.UI.DataViewGroupStore(), store: new Common.UI.DataViewStore(), itemTemplate: _.template('
'), - style: 'max-height: 350px;' + style: 'max-height: 350px;', + delayRenderTips: true }); }); this.btnTableTemplate.render($('#table-btn-template')); diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index cc434b41b..3708caab1 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -2021,7 +2021,8 @@ define([ restoreHeight: 300, style: 'max-height: 300px;', store: me.getCollection('TableTemplates'), - itemTemplate: _.template('
') + itemTemplate: _.template('
'), + delayRenderTips: true }); picker.on('item:click', function(picker, item, record) { diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettings.js b/apps/spreadsheeteditor/main/app/view/ChartSettings.js index ec7e483f6..ffd4d5e0d 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettings.js @@ -1001,7 +1001,8 @@ define([ cls: 'combo-chart-style', dataHint: '1', dataHintDirection: 'bottom', - dataHintOffset: 'big' + dataHintOffset: 'big', + delayRenderTips: true }); this.cmbChartStyle.render($('#chart-combo-style')); this.cmbChartStyle.openButton.menu.cmpEl.css({ @@ -1053,7 +1054,8 @@ define([ itemHeight: 50, menuMaxHeight: 272, enableKeyEvents: true, - cls: 'combo-spark-style' + cls: 'combo-spark-style', + delayRenderTips: true }); this.cmbSparkStyle.render($('#spark-combo-style')); this.cmbSparkStyle.openButton.menu.cmpEl.css({ diff --git a/apps/spreadsheeteditor/main/app/view/ChartTypeDialog.js b/apps/spreadsheeteditor/main/app/view/ChartTypeDialog.js index 80b13fbbc..ea234ef63 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartTypeDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ChartTypeDialog.js @@ -178,7 +178,8 @@ define([ '<%= title %>', '<% } %>', '
' - ].join('')) + ].join('')), + delayRenderTips: true }); this.stylesList.on('item:select', _.bind(this.onSelectStyles, this)); diff --git a/apps/spreadsheeteditor/main/app/view/TableSettings.js b/apps/spreadsheeteditor/main/app/view/TableSettings.js index 656464358..03484359b 100644 --- a/apps/spreadsheeteditor/main/app/view/TableSettings.js +++ b/apps/spreadsheeteditor/main/app/view/TableSettings.js @@ -531,7 +531,8 @@ define([ groups: new Common.UI.DataViewGroupStore(), store: new Common.UI.DataViewStore(), itemTemplate: _.template('
'), - style: 'max-height: 325px;' + style: 'max-height: 325px;', + delayRenderTips: true }); }); this.btnTableTemplate.render($('#table-btn-template'));