Fix Bug 50389. Refactoring listview.

This commit is contained in:
Julia Radzhabova 2021-05-13 20:30:57 +03:00
parent d9905d9789
commit cb6998eac6
13 changed files with 24 additions and 15 deletions

View file

@ -54,11 +54,12 @@ define([
showLast: true,
simpleAddMode: false,
keyMoveDirection: 'vertical',
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style=""><%= value %></div>')
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style=""><%= value %></div>'),
cls: ''
},
template: _.template([
'<div class="listview inner"></div>'
'<div class="listview inner <%= cls %>"></div>'
].join('')),
onResetItems : function() {

View file

@ -752,9 +752,9 @@ define([
el: $window.find('#symbol-table-special-list'),
store: new Common.UI.DataViewStore(data),
simpleAddMode: true,
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
cls: 'dbl-clickable',
itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="pointer-events:none;width: 100%;display:flex;">',
'<div id="<%= id %>" class="list-item" style="width: 100%;display:flex;">',
'<div style="width:70px;text-align: center; padding-right: 5px;"><%= symbol %></div>',
'<div style="flex-grow:1;padding-right: 5px;"><%= description %></div>',
'<% if (' + this.showShortcutKey + ') { %>',

View file

@ -79,6 +79,10 @@
opacity: @component-disabled-opacity;
}
}
.dbl-clickable& .list-item {
pointer-events: none;
}
}
.no-borders > .listview .item {

View file

@ -174,7 +174,8 @@ define([
el: $('#bookmarks-list', this.$window),
store: new Common.UI.DataViewStore(),
tabindex: 1,
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="pointer-events:none;overflow: hidden; text-overflow: ellipsis;"><%= Common.Utils.String.htmlEncode(value) %></div>')
cls: 'dbl-clickable',
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="overflow: hidden; text-overflow: ellipsis;"><%= Common.Utils.String.htmlEncode(value) %></div>')
});
this.bookmarksList.store.comparator = function(rec) {
return (me.radioName.getValue() ? rec.get("value") : rec.get("location"));

View file

@ -183,7 +183,8 @@ define([
this.refList = new Common.UI.ListView({
el: $window.find('#id-dlg-cross-list'),
store: new Common.UI.DataViewStore(),
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="pointer-events:none;overflow: hidden; text-overflow: ellipsis;white-space: pre;"><%= Common.Utils.String.htmlEncode(value) %></div>')
cls: 'dbl-clickable',
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="overflow: hidden; text-overflow: ellipsis;white-space: pre;"><%= Common.Utils.String.htmlEncode(value) %></div>')
});
this.refList.on('entervalue', _.bind(this.onPrimary, this))
.on('item:dblclick', _.bind(this.onPrimary, this));

View file

@ -124,7 +124,8 @@ define([
el: $('#datetime-dlg-format'),
store: new Common.UI.DataViewStore(),
tabindex: 1,
scrollAlwaysVisible: true
scrollAlwaysVisible: true,
cls: 'dbl-clickable'
});
this.listFormats.on('item:select', _.bind(this.onSelectFormat, this));

View file

@ -124,7 +124,8 @@ define([
el: $('#datetime-dlg-format'),
store: new Common.UI.DataViewStore(),
scrollAlwaysVisible: true,
tabindex: 1
tabindex: 1,
cls: 'dbl-clickable'
});
this.listFormats.on('item:select', _.bind(this.onSelectFormat, this));

View file

@ -271,7 +271,7 @@ define([
el: $('#formula-dlg-combo-functions'),
store: this.functions,
tabindex: 1,
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="pointer-events:none;"><%= value %></div>')
cls: 'dbl-clickable'
});
this.cmbListFunctions.on('item:select', _.bind(this.onSelectFunction, this));

View file

@ -111,7 +111,8 @@ define([
el: $('#macro-dlg-list', this.$window),
store: new Common.UI.DataViewStore(),
tabindex: 1,
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="pointer-events:none;overflow: hidden; text-overflow: ellipsis;"><%= value %></div>')
cls: 'dbl-clickable',
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="overflow: hidden; text-overflow: ellipsis;"><%= value %></div>')
});
this.macroList.on('item:dblclick', _.bind(this.onDblClickMacro, this));
this.macroList.on('entervalue', _.bind(this.onPrimary, this));

View file

@ -119,7 +119,6 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template',
store: new Common.UI.DataViewStore(),
simpleAddMode: true,
emptyText: this.textEmpty,
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="width: 100%;display:inline-block;<% if (!lock) { %>pointer-events:none;<% } %>">',
'<div class="listitem-icon toolbar__icon <% print(isTable?"btn-menu-table":(isSlicer ? "btn-slicer" : "btn-named-range")) %>"></div>',

View file

@ -90,10 +90,10 @@ define([
el: $('#named-range-paste-list', this.$window),
store: new Common.UI.DataViewStore(),
simpleAddMode: true,
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
cls: 'dbl-clickable',
itemTemplate: _.template([
'<div style="pointer-events:none;">',
'<div id="<%= id %>" class="list-item" style="pointer-events:none;width: 100%;display:inline-block;">',
'<div id="<%= id %>" class="list-item" style="width: 100%;display:inline-block;">',
'<div class="listitem-icon toolbar__icon <% print(isTable?"btn-menu-table":(isSlicer ? "btn-slicer" : "btn-named-range")) %>"></div>',
'<div style="width:186px;padding-right: 5px;"><%= Common.Utils.String.htmlEncode(name) %></div>',
'</div>',

View file

@ -1010,7 +1010,8 @@ define([
this.listNames = new Common.UI.ListView({
el: $('#status-list-names', $window),
store: new Common.UI.DataViewStore(pages),
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="pointer-events:none;"><%= Common.Utils.String.htmlEncode(value) %></div>')
cls: 'dbl-clickable',
itemTemplate: _.template('<div id="<%= id %>" class="list-item"><%= Common.Utils.String.htmlEncode(value) %></div>')
});
this.listNames.selectByIndex(0);

View file

@ -115,7 +115,6 @@ define([
store: new Common.UI.DataViewStore(),
simpleAddMode: true,
emptyText: this.textEmpty,
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="width: 100%;height: 20px;display:inline-block;<% if (!lock) { %>pointer-events:none;<% } %>">',
'<div style="width:100%;"><%= Common.Utils.String.htmlEncode(name) %></div>',