This repository has been archived by the owner on Dec 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from PolymerElements/implement-for-1.0
Implement iron-dropdown for Polymer 1.0
- Loading branch information
Showing
12 changed files
with
953 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
iron-dropdown | ||
============= | ||
|
||
An element that implements a simple drop-down menu widget with a trigger and content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!-- | ||
@license | ||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | ||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
Code distributed by Google as part of the polymer project is also | ||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
--> | ||
|
||
<link rel="import" href="../../polymer/polymer.html"> | ||
<link rel="import" href="../../neon-animation/neon-animation-behavior.html"> | ||
|
||
<script> | ||
Polymer({ | ||
is: 'expand-animation', | ||
|
||
behaviors: [ | ||
Polymer.NeonAnimationBehavior | ||
], | ||
|
||
configure: function(config) { | ||
var node = config.node; | ||
|
||
var height = node.getBoundingClientRect().height; | ||
|
||
this._effect = new KeyframeEffect(node, [{ | ||
height: (height / 2) + 'px' | ||
}, { | ||
height: height + 'px' | ||
}], this.timingFromConfig(config)); | ||
|
||
return this._effect; | ||
} | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!-- | ||
@license | ||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | ||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
Code distributed by Google as part of the polymer project is also | ||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
--> | ||
|
||
<link rel="import" href="../iron-dropdown.html"> | ||
<link rel="import" href="../../neon-animation/neon-animations.html"> | ||
<link rel="import" href="grow-height-animation.html"> | ||
|
||
<dom-module id="x-select"> | ||
<style> | ||
:host { | ||
display: inline-block; | ||
margin: 1em; | ||
} | ||
</style> | ||
<template> | ||
<div on-tap="open"> | ||
<content select=".dropdown-trigger"></content> | ||
</div> | ||
<iron-dropdown id="dropdown" | ||
vertical-align="[[verticalAlign]]" | ||
horizontal-align="[[horizontalAlign]]" | ||
disabled="[[disabled]]" | ||
open-animation-config="[[openAnimationConfig]]" | ||
close-animation-config="[[closeAnimationConfig]]"> | ||
<content select=".dropdown-content"></content> | ||
</iron-dropdown> | ||
</template> | ||
<script> | ||
Polymer({ | ||
is: 'x-select', | ||
|
||
properties: { | ||
verticalAlign: String, | ||
horizontalAlign: String, | ||
disabled: Boolean, | ||
openAnimationConfig: { | ||
type: Array, | ||
value: function() { | ||
return [{ | ||
name: 'fade-in-animation', | ||
timing: { | ||
delay: 150, | ||
duration: 50 | ||
} | ||
}, { | ||
name: 'expand-animation', | ||
timing: { | ||
delay: 150, | ||
duration: 200 | ||
} | ||
}]; | ||
} | ||
}, | ||
|
||
closeAnimationConfig: { | ||
type: Array, | ||
value: function() { | ||
return [{ | ||
name: 'fade-out-animation', | ||
timing: { | ||
duration: 200 | ||
} | ||
}]; | ||
} | ||
} | ||
}, | ||
|
||
open: function() { | ||
this.$.dropdown.open(); | ||
} | ||
}); | ||
</script> | ||
</dom-module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!doctype html> | ||
<!-- | ||
@license | ||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | ||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE | ||
The complete set of authors may be found at http://polymer.github.io/AUTHORS | ||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS | ||
Code distributed by Google as part of the polymer project is also | ||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS | ||
--> | ||
<html> | ||
<head> | ||
|
||
<title>iron-dropdown</title> | ||
<script src="../webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="../iron-component-page/iron-component-page.html"> | ||
|
||
</head> | ||
<body> | ||
|
||
<iron-component-page></iron-component-page> | ||
|
||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.