@polymer/paper-dialog-scrollable
Advanced tools
Comparing version
@@ -19,13 +19,15 @@ { | ||
"bower": "^1.8.0", | ||
"@polymer/iron-component-page": "3.0.0-pre.12", | ||
"@polymer/iron-demo-helpers": "3.0.0-pre.12", | ||
"@polymer/paper-button": "3.0.0-pre.12", | ||
"@polymer/paper-dialog": "3.0.0-pre.12", | ||
"wct-browser-legacy": "0.0.1-pre.11", | ||
"@webcomponents/webcomponentsjs": "^1.0.0" | ||
"webmat": "^0.2.0", | ||
"@polymer/iron-component-page": "^3.0.0-pre.13", | ||
"@polymer/iron-demo-helpers": "^3.0.0-pre.13", | ||
"@polymer/paper-button": "^3.0.0-pre.13", | ||
"@polymer/paper-dialog": "^3.0.0-pre.13", | ||
"wct-browser-legacy": "^0.0.1-pre.11", | ||
"@webcomponents/webcomponentsjs": "^2.0.0-0" | ||
}, | ||
"scripts": { | ||
"update-types": "bower install && gen-typescript-declarations --deleteExisting --outDir ." | ||
"update-types": "bower install && gen-typescript-declarations --deleteExisting --outDir .", | ||
"format": "webmat && npm run update-types" | ||
}, | ||
"version": "3.0.0-pre.12", | ||
"version": "3.0.0-pre.13", | ||
"resolutions": { | ||
@@ -40,7 +42,7 @@ "inherits": "2.0.3", | ||
"dependencies": { | ||
"@polymer/iron-flex-layout": "3.0.0-pre.12", | ||
"@polymer/paper-dialog-behavior": "3.0.0-pre.12", | ||
"@polymer/paper-styles": "3.0.0-pre.12", | ||
"@polymer/polymer": "3.0.0-pre.12" | ||
"@polymer/iron-flex-layout": "^3.0.0-pre.13", | ||
"@polymer/paper-dialog-behavior": "^3.0.0-pre.13", | ||
"@polymer/paper-styles": "^3.0.0-pre.13", | ||
"@polymer/polymer": "^3.0.0-pre.13" | ||
} | ||
} |
@@ -1,8 +0,1 @@ | ||
import '@polymer/polymer/polymer-legacy.js'; | ||
import '@polymer/iron-flex-layout/iron-flex-layout.js'; | ||
import { PaperDialogBehaviorImpl } from '@polymer/paper-dialog-behavior/paper-dialog-behavior.js'; | ||
import '@polymer/paper-styles/default-theme.js'; | ||
import { Polymer } from '@polymer/polymer/lib/legacy/polymer-fn.js'; | ||
import { html } from '@polymer/polymer/lib/utils/html-tag.js'; | ||
/** | ||
@@ -72,2 +65,14 @@ @license | ||
*/ | ||
/* | ||
FIXME(polymer-modulizer): the above comments were extracted | ||
from HTML and may be out of place here. Review them and | ||
then delete this comment! | ||
*/ | ||
import '../polymer/polymer-legacy.js'; | ||
import '../iron-flex-layout/iron-flex-layout.js'; | ||
import { PaperDialogBehaviorImpl } from '../paper-dialog-behavior/paper-dialog-behavior.js'; | ||
import '../paper-styles/default-theme.js'; | ||
import { Polymer } from '../polymer/lib/legacy/polymer-fn.js'; | ||
import { html } from '../polymer/lib/utils/html-tag.js'; | ||
Polymer({ | ||
@@ -124,8 +129,7 @@ _template: html` | ||
/** | ||
* The dialog element that implements `Polymer.PaperDialogBehavior` containing this element. | ||
* The dialog element that implements `Polymer.PaperDialogBehavior` | ||
* containing this element. | ||
* @type {?Node} | ||
*/ | ||
dialogElement: { | ||
type: Object | ||
} | ||
dialogElement: {type: Object} | ||
@@ -141,3 +145,3 @@ }, | ||
ready: function () { | ||
ready: function() { | ||
this._ensureTarget(); | ||
@@ -154,13 +158,19 @@ this.classList.add('no-padding'); | ||
this.toggleClass('is-scrolled', this.scrollTarget.scrollTop > 0); | ||
this.toggleClass('can-scroll', this.scrollTarget.offsetHeight < this.scrollTarget.scrollHeight); | ||
this.toggleClass('scrolled-to-bottom', | ||
this.scrollTarget.scrollTop + this.scrollTarget.offsetHeight >= this.scrollTarget.scrollHeight); | ||
this.toggleClass( | ||
'can-scroll', | ||
this.scrollTarget.offsetHeight < this.scrollTarget.scrollHeight); | ||
this.toggleClass( | ||
'scrolled-to-bottom', | ||
this.scrollTarget.scrollTop + this.scrollTarget.offsetHeight >= | ||
this.scrollTarget.scrollHeight); | ||
}, | ||
_ensureTarget: function () { | ||
_ensureTarget: function() { | ||
// Read parentElement instead of parentNode in order to skip shadowRoots. | ||
this.dialogElement = this.dialogElement || this.parentElement; | ||
// Check if dialog implements paper-dialog-behavior. If not, fit scrollTarget to host. | ||
// Check if dialog implements paper-dialog-behavior. If not, fit | ||
// scrollTarget to host. | ||
if (this.dialogElement && this.dialogElement.behaviors && | ||
this.dialogElement.behaviors.indexOf(PaperDialogBehaviorImpl) >= 0) { | ||
this.dialogElement.behaviors.indexOf(PaperDialogBehaviorImpl) >= | ||
0) { | ||
this.dialogElement.sizingTarget = this.scrollTarget; | ||
@@ -167,0 +177,0 @@ this.scrollTarget.classList.remove('fit'); |
@@ -1,4 +0,1 @@ | ||
import { PaperDialogBehavior } from '@polymer/paper-dialog-behavior/paper-dialog-behavior.js'; | ||
import { Polymer } from '@polymer/polymer/lib/legacy/polymer-fn.js'; | ||
import { html } from '@polymer/polymer/lib/utils/html-tag.js'; | ||
/** | ||
@@ -13,2 +10,6 @@ @license | ||
*/ | ||
import { PaperDialogBehavior } from '../../paper-dialog-behavior/paper-dialog-behavior.js'; | ||
import { Polymer } from '../../polymer/lib/legacy/polymer-fn.js'; | ||
import { html } from '../../polymer/lib/utils/html-tag.js'; | ||
Polymer({ | ||
@@ -15,0 +16,0 @@ _template: html` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
57860
1.73%202
5.21%9
12.5%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed