mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
JS: fix multiselect burning resources
Especially on browsers with slow JS like IE8 iterating again and again over all rows used to harm response rendering. Immagine a dasboard with a total of a few hundred rows refreshing every 10 seconds while taking 3 secs to render one dashlet... it's far better right now. refs #6417
This commit is contained in:
parent
72a2ec41ba
commit
ca6b373be2
@ -38,3 +38,11 @@ table.historycolorgrid a {
|
|||||||
table.historycolorgrid a:hover {
|
table.historycolorgrid a:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.multiselect tr[href] td {
|
||||||
|
user-select: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
this.applyGlobalDefaults();
|
this.applyGlobalDefaults();
|
||||||
this.applyHandlers($('#layout'));
|
this.applyHandlers($('#layout'));
|
||||||
this.icinga.ui.prepareContainers();
|
this.icinga.ui.prepareContainers();
|
||||||
this.icinga.ui.prepareMultiselectTables($(document));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// TODO: What's this?
|
// TODO: What's this?
|
||||||
|
@ -412,9 +412,6 @@
|
|||||||
|
|
||||||
this.icinga.ui.initializeTriStates($resp);
|
this.icinga.ui.initializeTriStates($resp);
|
||||||
|
|
||||||
// Make multiselection-tables not selectable.
|
|
||||||
this.icinga.ui.prepareMultiselectTables($resp);
|
|
||||||
|
|
||||||
// Replace images with sparklines.
|
// Replace images with sparklines.
|
||||||
$resp.find('img.inlinepie').each(function(){
|
$resp.find('img.inlinepie').each(function(){
|
||||||
self.icinga.ui.initializeSparklines($(this));
|
self.icinga.ui.initializeSparklines($(this));
|
||||||
|
@ -276,19 +276,6 @@
|
|||||||
*/
|
*/
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Prepare all multiselectable tables for multi-selection by
|
|
||||||
* removing the regular text selection.
|
|
||||||
*/
|
|
||||||
prepareMultiselectTables: function () {
|
|
||||||
var $rows = $('table.multiselect tr[href]');
|
|
||||||
$rows.find('td').attr('unselectable', 'on')
|
|
||||||
.css('user-select', 'none')
|
|
||||||
.css('-webkit-user-select', 'none')
|
|
||||||
.css('-moz-user-select', 'none')
|
|
||||||
.css('-ms-user-select', 'none');
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the given table-row to the selection of the closest
|
* Add the given table-row to the selection of the closest
|
||||||
* table and deselect all other rows of the closest table.
|
* table and deselect all other rows of the closest table.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user