Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Add CoreResizable support.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Dec 3, 2014
1 parent 86881fc commit 349eb1d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": true,
"dependencies": {
"polymer": "Polymer/polymer#master",
"core-transition": "Polymer/core-transition#master"
"core-transition": "Polymer/core-transition#master",
"core-resizable": "Polymer/core-resizable#master"
}
}
23 changes: 19 additions & 4 deletions core-overlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../core-transition/core-transition.html">
<link rel="import" href="../core-resizable/core-resizable.html">
<link rel="import" href="core-key-helper.html">
<link rel="import" href="core-overlay-layer.html">

Expand Down Expand Up @@ -115,7 +116,7 @@ <h2>Dialog</h2>
<script>
(function() {

Polymer('core-overlay', {
Polymer(Polymer.mixin({

publish: {
/**
Expand Down Expand Up @@ -236,7 +237,19 @@ <h2>Dialog</h2>
'keydown': 'keydownHandler',
'core-transitionend': 'transitionend'
},


attached: function() {
this.resizerAttachedHandler();
},

detached: function() {
this.resizerDetachedHandler();
},

resizerShouldNotify: function() {
return this.opened;
},

registerCallback: function(element) {
this.layer = document.createElement('core-overlay-layer');
this.keyHelper = document.createElement('core-key-helper');
Expand Down Expand Up @@ -387,6 +400,7 @@ <h2>Dialog</h2>
// tasks which cause the overlay to actually open; typically play an
// animation
renderOpened: function() {
this.notifyResize();
var transition = this.getTransition();
if (transition) {
transition.go(this.target, {opened: this.opened});
Expand Down Expand Up @@ -675,8 +689,9 @@ <h2>Dialog</h2>
};
}
return this[bound];
},
});
}

}, Polymer.CoreResizer));

// TODO(sorvell): This should be an element with private state so it can
// be independent of overlay.
Expand Down

0 comments on commit 349eb1d

Please sign in to comment.