[DE] Refactorint languages menu

This commit is contained in:
Julia Radzhabova 2019-08-10 17:02:16 +03:00
parent 6c0aca5bce
commit a50379abc6
3 changed files with 4 additions and 6 deletions

View file

@ -603,7 +603,6 @@ define([
'<ul class="dropdown-menu <%= options.cls %>" oo_editor_input="true" style="<%= options.style %>" role="menu">', '<ul class="dropdown-menu <%= options.cls %>" oo_editor_input="true" style="<%= options.style %>" role="menu">',
'<% _.each(items, function(item) { %>', '<% _.each(items, function(item) { %>',
'<% if (!item.id) item.id = Common.UI.getId(); %>', '<% if (!item.id) item.id = Common.UI.getId(); %>',
'<% item.checkable = item.checkable || false; %>',
'<% item.checked = item.checked || false; %>', '<% item.checked = item.checked || false; %>',
'<li><%= itemTemplate(item) %></li>', '<li><%= itemTemplate(item) %></li>',
'<% }) %>', '<% }) %>',
@ -620,7 +619,7 @@ define([
'<a id="<%= id %>" <% if(typeof style !== "undefined") { %> style="<%= style %>" <% } %>', '<a id="<%= id %>" <% if(typeof style !== "undefined") { %> style="<%= style %>" <% } %>',
'<% if(typeof canFocused !== "undefined") { %> tabindex="-1" type="menuitem" <% } %>', '<% if(typeof canFocused !== "undefined") { %> tabindex="-1" type="menuitem" <% } %>',
'<% if(typeof stopPropagation !== "undefined") { %> data-stopPropagation="true" <% } %>', '<% if(typeof stopPropagation !== "undefined") { %> data-stopPropagation="true" <% } %>',
'class="<% if (checked) { %> checked <% } %> <% if (checkable) { %> checkable <% } %>" >', 'class="<% if (checked) { %> checked <% } %>" >',
'<% if (typeof iconCls !== "undefined") { %>', '<% if (typeof iconCls !== "undefined") { %>',
'<span class="menu-item-icon <%= iconCls %>"></span>', '<span class="menu-item-icon <%= iconCls %>"></span>',
'<% } %>', '<% } %>',
@ -726,7 +725,6 @@ define([
var template = _.template([ var template = _.template([
'<% _.each(items, function(item) { %>', '<% _.each(items, function(item) { %>',
'<% if (!item.id) item.id = Common.UI.getId(); %>', '<% if (!item.id) item.id = Common.UI.getId(); %>',
'<% item.checkable = item.checkable || false; %>',
'<% item.checked = item.checked || false; %>', '<% item.checked = item.checked || false; %>',
'<li><%= itemTemplate(item) %></li>', '<li><%= itemTemplate(item) %></li>',
'<% }) %>' '<% }) %>'
@ -768,7 +766,7 @@ define([
if (item.disabled) if (item.disabled)
return false; return false;
if (!item.checked) if (item.checkable && !item.checked)
this.setChecked(index, !item.checked); this.setChecked(index, !item.checked);
this.isOver = false; this.isOver = false;

View file

@ -2709,7 +2709,7 @@ define([
}); });
var langTemplate = _.template([ var langTemplate = _.template([
'<a id="<%= id %>" tabindex="-1" type="menuitem" style="padding-left: 28px !important;" langval="<%= value %>">', '<a id="<%= id %>" tabindex="-1" type="menuitem" style="padding-left: 28px !important;" langval="<%= value %>" class="<% if (checked) { %> checked <% } %>">',
'<i class="icon <% if (spellcheck) { %> img-toolbarmenu spellcheck-lang <% } %>"></i>', '<i class="icon <% if (spellcheck) { %> img-toolbarmenu spellcheck-lang <% } %>"></i>',
'<%= caption %>', '<%= caption %>',
'</a>' '</a>'

View file

@ -233,7 +233,7 @@ define([
style: 'margin-top:-5px;', style: 'margin-top:-5px;',
restoreHeight: 300, restoreHeight: 300,
itemTemplate: _.template([ itemTemplate: _.template([
'<a id="<%= id %>" tabindex="-1" type="menuitem" style="padding-left: 28px !important;" langval="<%= value.value %>" class="<% if (checked) { %> checked <% } %> <% if (checkable) { %> checkable <% } %>">', '<a id="<%= id %>" tabindex="-1" type="menuitem" style="padding-left: 28px !important;" langval="<%= value.value %>" class="<% if (checked) { %> checked <% } %>">',
'<i class="icon <% if (spellcheck) { %> img-toolbarmenu spellcheck-lang <% } %>"></i>', '<i class="icon <% if (spellcheck) { %> img-toolbarmenu spellcheck-lang <% } %>"></i>',
'<%= caption %>', '<%= caption %>',
'</a>' '</a>'