Update frontend
This commit is contained in:
parent
d3adc6ddfb
commit
d3bc8519c0
10 changed files with 46 additions and 12 deletions
|
@ -3,14 +3,14 @@
|
|||
FINGERPRINTS = {
|
||||
"compatibility.js": "8e4c44b5f4288cc48ec1ba94a9bec812",
|
||||
"core.js": "d4a7cb8c80c62b536764e0e81385f6aa",
|
||||
"frontend.html": "a4a80d080060120ee62c7537821347fd",
|
||||
"mdi.html": "1a5ad9654c1f0e57440e30afd92846a5",
|
||||
"frontend.html": "21e9df215b242fbc6a3f9b262db0aac7",
|
||||
"mdi.html": "c92bd28c434865d6cabb34cd3c0a3e4c",
|
||||
"micromarkdown-js.html": "93b5ec4016f0bba585521cf4d18dec1a",
|
||||
"panels/ha-panel-automation.html": "4f98839bb082885657bbcd0ac04fc680",
|
||||
"panels/ha-panel-config.html": "4582988554e986c8d3affbb98be1e8bf",
|
||||
"panels/ha-panel-dev-event.html": "4886c821235492b1b92739b580d21c61",
|
||||
"panels/ha-panel-dev-info.html": "24e888ec7a8acd0c395b34396e9001bc",
|
||||
"panels/ha-panel-dev-service.html": "19a7e5bda34164cfa6f4911348966200",
|
||||
"panels/ha-panel-dev-service.html": "ace433c5529ffc065d460b2f6177548f",
|
||||
"panels/ha-panel-dev-state.html": "8f1a27c04db6329d31cfcc7d0d6a0869",
|
||||
"panels/ha-panel-dev-template.html": "d33f2a3aface10754ac33adbcadc3f0d",
|
||||
"panels/ha-panel-hassio.html": "9474ba65077371622f21ed9a30cf5229",
|
||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1 +1 @@
|
|||
Subproject commit 48b94d654678d73769e999c4aa24b4a97541f87e
|
||||
Subproject commit d2a56655d086a040e712680e46e191d78949dfa3
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -223,7 +223,8 @@
|
|||
grid: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
reflectToAttribute: true
|
||||
reflectToAttribute: true,
|
||||
observer: '_gridChanged'
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -493,7 +494,8 @@
|
|||
* The largest n-th value for an item such that it can be rendered in `_physicalStart`.
|
||||
*/
|
||||
get _maxVirtualStart() {
|
||||
return Math.max(0, this._virtualCount - this._physicalCount);
|
||||
var virtualCount = this._convertIndexToCompleteRow(this._virtualCount);
|
||||
return Math.max(0, virtualCount - this._physicalCount);
|
||||
},
|
||||
|
||||
set _virtualStart(val) {
|
||||
|
@ -837,6 +839,14 @@
|
|||
_increasePoolIfNeeded: function(count) {
|
||||
var nextPhysicalCount = this._clamp(this._physicalCount + count,
|
||||
DEFAULT_PHYSICAL_COUNT, this._virtualCount - this._virtualStart);
|
||||
nextPhysicalCount = this._convertIndexToCompleteRow(nextPhysicalCount);
|
||||
if (this.grid) {
|
||||
var correction = nextPhysicalCount % this._itemsPerRow;
|
||||
if (correction && nextPhysicalCount - correction <= this._physicalCount) {
|
||||
nextPhysicalCount += this._itemsPerRow;
|
||||
}
|
||||
nextPhysicalCount -= correction;
|
||||
}
|
||||
var delta = nextPhysicalCount - this._physicalCount;
|
||||
var nextIncrease = Math.round(this._physicalCount * 0.5);
|
||||
|
||||
|
@ -861,7 +871,9 @@
|
|||
this._templateCost = (window.performance.now() - ts) / delta;
|
||||
nextIncrease = Math.round(this._physicalCount * 0.5);
|
||||
}
|
||||
if (this._virtualEnd === this._virtualCount - 1 || nextIncrease === 0) {
|
||||
// The upper bounds is not fixed when dealing with a grid that doesn't
|
||||
// fill it's last row with the exact number of items per row.
|
||||
if (this._virtualEnd >= this._virtualCount - 1 || nextIncrease === 0) {
|
||||
// Do nothing.
|
||||
} else if (!this._isClientFull()) {
|
||||
this._debounceRender(
|
||||
|
@ -922,6 +934,13 @@
|
|||
this.templatize(this._userTemplate, this.mutableData);
|
||||
},
|
||||
|
||||
_gridChanged: function(newGrid, oldGrid) {
|
||||
if (typeof oldGrid === 'undefined') return;
|
||||
this.notifyResize();
|
||||
Polymer.flush ? Polymer.flush() : Polymer.dom.flush();
|
||||
this._updateGridMetrics();
|
||||
},
|
||||
|
||||
/**
|
||||
* Called when the items have changed. That is, ressignments
|
||||
* to `items`, splices or updates to a single item.
|
||||
|
@ -1021,6 +1040,7 @@
|
|||
// remove the current focused item
|
||||
if (this._focusedItem && this.modelForElement(this._focusedItem)[this.as] === item) {
|
||||
this._removeFocusedItem();
|
||||
document.activeElement && document.activeElement.blur && document.activeElement.blur();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1121,7 +1141,9 @@
|
|||
this._updateGridMetrics();
|
||||
this._physicalSize = Math.ceil(this._physicalCount / this._itemsPerRow) * this._rowHeight;
|
||||
} else {
|
||||
oldPhysicalSize = (this._itemsPerRow === 1) ? oldPhysicalSize : Math.ceil(this._physicalCount / this._itemsPerRow) * this._rowHeight;
|
||||
this._physicalSize = this._physicalSize + newPhysicalSize - oldPhysicalSize;
|
||||
this._itemsPerRow = 1;
|
||||
}
|
||||
// Update the average if it measured something.
|
||||
if (this._physicalAverageCount !== prevAvgCount) {
|
||||
|
@ -1310,6 +1332,9 @@
|
|||
*/
|
||||
_resizeHandler: function() {
|
||||
this._debounceRender(function() {
|
||||
// clear cached visible index.
|
||||
this._firstVisibleIndexVal = null;
|
||||
this._lastVisibleIndexVal = null;
|
||||
// Skip the resize event on touch devices when the address bar slides up.
|
||||
var delta = Math.abs(this._viewportHeight - this._scrollTargetHeight);
|
||||
this.updateViewportBoundaries();
|
||||
|
@ -1532,6 +1557,16 @@
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts a random index to the index of the item that completes it's row.
|
||||
* Allows for better order and fill computation when grid == true.
|
||||
*/
|
||||
_convertIndexToCompleteRow: function(idx) {
|
||||
// when grid == false _itemPerRow can be unset.
|
||||
this._itemsPerRow = this._itemsPerRow || 1;
|
||||
return this.grid ? Math.ceil(idx / this._itemsPerRow) * this._itemsPerRow : idx;
|
||||
},
|
||||
|
||||
_isIndexRendered: function(idx) {
|
||||
return idx >= this._virtualStart && idx <= this._virtualEnd;
|
||||
},
|
||||
|
@ -1586,7 +1621,6 @@
|
|||
this._focusedItem = null;
|
||||
this._focusedVirtualIndex = -1;
|
||||
this._focusedPhysicalIndex = -1;
|
||||
document.activeElement && document.activeElement.blur && document.activeElement.blur();
|
||||
},
|
||||
|
||||
_createFocusBackfillItem: function() {
|
||||
|
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
Add table
Reference in a new issue