Remove all usage on POLYMER2
code base is on polymer 2 already
Change-Id: Ic5c9e3181c972fb5baeab3d870276005a7e9fcf0
(cherry picked from commit 34486c286e
)
This commit is contained in:
@@ -369,7 +369,6 @@
|
||||
},
|
||||
|
||||
_getListItems() {
|
||||
// Polymer2: querySelectorAll returns NodeList instead of Array.
|
||||
return Array.from(
|
||||
Polymer.dom(this.root).querySelectorAll('gr-change-list-item'));
|
||||
},
|
||||
|
@@ -332,7 +332,6 @@
|
||||
},
|
||||
|
||||
get diffs() {
|
||||
// Polymer2: querySelectorAll returns NodeList instead of Array.
|
||||
return Array.from(
|
||||
Polymer.dom(this.root).querySelectorAll('gr-diff-host'));
|
||||
},
|
||||
@@ -926,7 +925,6 @@
|
||||
_filesChanged() {
|
||||
if (this._files && this._files.length > 0) {
|
||||
Polymer.dom.flush();
|
||||
// Polymer2: querySelectorAll returns NodeList instead of Array.
|
||||
const files = Array.from(
|
||||
Polymer.dom(this.root).querySelectorAll('.file-row'));
|
||||
this.$.fileCursor.stops = files;
|
||||
|
@@ -422,7 +422,6 @@
|
||||
* @return {!Array<!HTMLElement>}
|
||||
*/
|
||||
getThreadEls() {
|
||||
// Polymer2: querySelectorAll returns NodeList instead of Array.
|
||||
return Array.from(
|
||||
Polymer.dom(this.$.diff).querySelectorAll('.comment-thread'));
|
||||
},
|
||||
|
@@ -73,8 +73,6 @@
|
||||
},
|
||||
|
||||
_handleDownOnRangeComment(node) {
|
||||
// Keep the original behavior in polymer 1
|
||||
if (!window.POLYMER2) return false;
|
||||
if (node &&
|
||||
node.nodeName &&
|
||||
node.nodeName.toLowerCase() === 'gr-comment-thread') {
|
||||
@@ -183,13 +181,10 @@
|
||||
* For Polymer 2, use shadowRoot.getSelection instead.
|
||||
*/
|
||||
_getSelection() {
|
||||
let selection;
|
||||
if (window.POLYMER2) {
|
||||
const diffHost = util.querySelector(document.body, 'gr-diff');
|
||||
selection = diffHost &&
|
||||
diffHost.shadowRoot &&
|
||||
diffHost.shadowRoot.getSelection();
|
||||
}
|
||||
const diffHost = util.querySelector(document.body, 'gr-diff');
|
||||
const selection = diffHost &&
|
||||
diffHost.shadowRoot &&
|
||||
diffHost.shadowRoot.getSelection();
|
||||
return selection ? selection: window.getSelection();
|
||||
},
|
||||
|
||||
|
@@ -436,7 +436,6 @@
|
||||
return [];
|
||||
}
|
||||
|
||||
// Polymer2: querySelectorAll returns NodeList instead of Array.
|
||||
return Array.from(
|
||||
Polymer.dom(this.root).querySelectorAll('.diff-row'));
|
||||
},
|
||||
|
@@ -169,10 +169,7 @@
|
||||
dialog.querySelectorAll('gr-autocomplete')
|
||||
.forEach(input => { input.text = ''; });
|
||||
|
||||
// TODO: reveiw binding for input after drop Polymer 1 support
|
||||
// All docs related to Polymer 2 set binding only for iron-input,
|
||||
// and doesn't add binding to input.
|
||||
dialog.querySelectorAll(window.POLYMER2 ? 'iron-input' : 'input')
|
||||
dialog.querySelectorAll('iron-input')
|
||||
.forEach(input => { input.bindValue = ''; });
|
||||
}
|
||||
|
||||
|
@@ -74,7 +74,6 @@
|
||||
},
|
||||
|
||||
_getEndpointParams() {
|
||||
// Polymer2: querySelectorAll returns NodeList instead of Array.
|
||||
return Array.from(
|
||||
Polymer.dom(this).querySelectorAll('gr-endpoint-param'));
|
||||
},
|
||||
|
@@ -41,7 +41,6 @@
|
||||
* @return {!Array<string>}
|
||||
*/
|
||||
_getDisplayedColumns() {
|
||||
// Polymer2: querySelectorAll returns NodeList instead of Array.
|
||||
return Array.from(Polymer.dom(this.root)
|
||||
.querySelectorAll('.checkboxContainer input:not([name=number])'))
|
||||
.filter(checkbox => checkbox.checked)
|
||||
|
@@ -119,7 +119,6 @@
|
||||
},
|
||||
|
||||
get accountChips() {
|
||||
// Polymer2: querySelectorAll returns NodeList instead of Array.
|
||||
return Array.from(
|
||||
Polymer.dom(this.root).querySelectorAll('gr-account-chip'));
|
||||
},
|
||||
|
@@ -161,7 +161,6 @@
|
||||
if (this.suggestions.length > 0) {
|
||||
if (!this.isHidden) {
|
||||
Polymer.dom.flush();
|
||||
// Polymer2: querySelectorAll returns NodeList instead of Array.
|
||||
this._suggestionEls = Array.from(
|
||||
this.$.suggestions.querySelectorAll('li'));
|
||||
this._resetCursorIndex();
|
||||
|
@@ -20,7 +20,6 @@ limitations under the License.
|
||||
href="/bower_components/polymer-resin/standalone/polymer-resin.html" />
|
||||
<link rel="import" href="../behaviors/safe-types-behavior/safe-types-behavior.html">
|
||||
<script>
|
||||
window.POLYMER2 = true;
|
||||
security.polymer_resin.install({
|
||||
allowedIdentifierPrefixes: [''],
|
||||
reportHandler(isViolation, fmt, ...args) {
|
||||
|
@@ -15,8 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
window.POLYMER2 = true;
|
||||
|
||||
/**
|
||||
* Helps looking up the proper iron-input element during the Polymer 2
|
||||
* transition. Polymer 2 uses the <iron-input> element, while Polymer 1 uses
|
||||
|
Reference in New Issue
Block a user