[DE] Refactoring context menu
This commit is contained in:
parent
6877a0ad81
commit
7c7d91998f
|
@ -417,7 +417,9 @@ define([
|
||||||
view.menuParagraphDirection.menu.on('item:click', _.bind(me.paragraphDirection, me));
|
view.menuParagraphDirection.menu.on('item:click', _.bind(me.paragraphDirection, me));
|
||||||
view.langParaMenu.menu.on('item:click', _.bind(me.onLangMenu, me, 'para'));
|
view.langParaMenu.menu.on('item:click', _.bind(me.onLangMenu, me, 'para'));
|
||||||
view.langTableMenu.menu.on('item:click', _.bind(me.onLangMenu, me, 'table'));
|
view.langTableMenu.menu.on('item:click', _.bind(me.onLangMenu, me, 'table'));
|
||||||
|
view.menuTableTOC.menu.on('item:click', _.bind(me.onTOCMenu, me));
|
||||||
|
view.menuParaTOCRefresh.menu.on('item:click', _.bind(me.onTOCMenu, me));
|
||||||
|
view.menuParaTOCSettings.on('click', _.bind(me.onParaTOCSettings, me));
|
||||||
},
|
},
|
||||||
|
|
||||||
getView: function (name) {
|
getView: function (name) {
|
||||||
|
@ -2219,11 +2221,19 @@ define([
|
||||||
if (!_.isUndefined(item.langid))
|
if (!_.isUndefined(item.langid))
|
||||||
me.api.put_TextPrLang(item.langid);
|
me.api.put_TextPrLang(item.langid);
|
||||||
|
|
||||||
(type=='para') ? (me.documentHolder._currLang.paraid = item.langid) : (me.documentHolder._currLang.tableid = item.langid);
|
(type==='para') ? (me.documentHolder._currLang.paraid = item.langid) : (me.documentHolder._currLang.tableid = item.langid);
|
||||||
me.editComplete();
|
me.editComplete();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onTOCMenu: function(menu, item, e) {
|
||||||
|
this.documentHolder.fireEvent((item.value==='settings') ? 'links:contents' : 'links:update', [item.value, true]);
|
||||||
|
},
|
||||||
|
|
||||||
|
onParaTOCSettings: function(item, e) {
|
||||||
|
this.documentHolder.fireEvent('links:contents', [item.value, true]);
|
||||||
|
},
|
||||||
|
|
||||||
editComplete: function() {
|
editComplete: function() {
|
||||||
this.documentHolder && this.documentHolder.fireEvent('editcomplete', this.documentHolder);
|
this.documentHolder && this.documentHolder.fireEvent('editcomplete', this.documentHolder);
|
||||||
}
|
}
|
||||||
|
|
|
@ -905,7 +905,7 @@ define([
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var menuTableTOC = new Common.UI.MenuItem({
|
me.menuTableTOC = new Common.UI.MenuItem({
|
||||||
caption : me.textTOC,
|
caption : me.textTOC,
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
cls: 'shifted-right',
|
cls: 'shifted-right',
|
||||||
|
@ -926,9 +926,6 @@ define([
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
menuTableTOC.menu.on('item:click', function (menu, item, e) {
|
|
||||||
me.fireEvent((item.value=='settings') ? 'links:contents' : 'links:update', [item.value, true]);
|
|
||||||
});
|
|
||||||
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
me.menuAddCommentTable = new Common.UI.MenuItem({
|
me.menuAddCommentTable = new Common.UI.MenuItem({
|
||||||
|
@ -1415,7 +1412,7 @@ define([
|
||||||
menuTableControl.setVisible(in_control);
|
menuTableControl.setVisible(in_control);
|
||||||
me.menuTableRemoveForm.setVisible(in_control);
|
me.menuTableRemoveForm.setVisible(in_control);
|
||||||
}
|
}
|
||||||
menuTableTOC.setVisible(in_toc);
|
me.menuTableTOC.setVisible(in_toc);
|
||||||
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
// comments
|
// comments
|
||||||
|
@ -1472,7 +1469,7 @@ define([
|
||||||
menuHyperlinkSeparator,
|
menuHyperlinkSeparator,
|
||||||
me.menuTableRemoveForm,
|
me.menuTableRemoveForm,
|
||||||
menuTableControl,
|
menuTableControl,
|
||||||
menuTableTOC,
|
me.menuTableTOC,
|
||||||
me.menuParagraphAdvancedInTable
|
me.menuParagraphAdvancedInTable
|
||||||
]
|
]
|
||||||
}).on('hide:after', function(menu, e, isFromInputControl) {
|
}).on('hide:after', function(menu, e, isFromInputControl) {
|
||||||
|
@ -1752,14 +1749,12 @@ define([
|
||||||
caption : '--'
|
caption : '--'
|
||||||
});
|
});
|
||||||
|
|
||||||
var menuParaTOCSettings = new Common.UI.MenuItem({
|
me.menuParaTOCSettings = new Common.UI.MenuItem({
|
||||||
caption: me.textTOCSettings,
|
caption: me.textTOCSettings,
|
||||||
value: 'settings'
|
value: 'settings'
|
||||||
}).on('click', function (item, e) {
|
|
||||||
me.fireEvent('links:contents', [item.value, true]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var menuParaTOCRefresh = new Common.UI.MenuItem({
|
me.menuParaTOCRefresh = new Common.UI.MenuItem({
|
||||||
caption : me.textUpdateTOC,
|
caption : me.textUpdateTOC,
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
cls: 'shifted-right',
|
cls: 'shifted-right',
|
||||||
|
@ -1776,9 +1771,6 @@ define([
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
menuParaTOCRefresh.menu.on('item:click', function (menu, item, e) {
|
|
||||||
me.fireEvent('links:update', [item.value, true]);
|
|
||||||
});
|
|
||||||
|
|
||||||
var menuParaTOCSeparator = new Common.UI.MenuItem({
|
var menuParaTOCSeparator = new Common.UI.MenuItem({
|
||||||
caption : '--'
|
caption : '--'
|
||||||
|
@ -1991,8 +1983,8 @@ define([
|
||||||
spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.DateTime;
|
spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.DateTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
menuParaTOCSettings.setVisible(in_toc);
|
me.menuParaTOCSettings.setVisible(in_toc);
|
||||||
menuParaTOCRefresh.setVisible(in_toc);
|
me.menuParaTOCRefresh.setVisible(in_toc);
|
||||||
menuParaTOCSeparator.setVisible(in_toc);
|
menuParaTOCSeparator.setVisible(in_toc);
|
||||||
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
|
@ -2055,8 +2047,8 @@ define([
|
||||||
menuParaControlSeparator,
|
menuParaControlSeparator,
|
||||||
me.menuParaRefreshField,
|
me.menuParaRefreshField,
|
||||||
menuParaFieldSeparator,
|
menuParaFieldSeparator,
|
||||||
menuParaTOCSettings,
|
me.menuParaTOCSettings,
|
||||||
menuParaTOCRefresh,
|
me.menuParaTOCRefresh,
|
||||||
menuParaTOCSeparator,
|
menuParaTOCSeparator,
|
||||||
me.menuParagraphBreakBefore,
|
me.menuParagraphBreakBefore,
|
||||||
me.menuParagraphKeepLines,
|
me.menuParagraphKeepLines,
|
||||||
|
|
Loading…
Reference in a new issue