This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
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 #8 from Polymer/master
8/8 master -> stable
- Loading branch information
Showing
28 changed files
with
352 additions
and
166 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 @@ | ||
/docs | ||
|
||
/node_modules | ||
build.bat |
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,23 @@ | ||
|
||
<!doctype html> | ||
<!-- | ||
Copyright 2013 The Polymer Authors. All rights reserved. | ||
Use of this source code is governed by a BSD-style | ||
license that can be found in the LICENSE file. | ||
--> | ||
<html> | ||
<head> | ||
<title>Arrows</title> | ||
<script src="../../polymer/polymer.js"></script> | ||
<link rel="import" href="polymer-ui-arrow.html"> | ||
</head> | ||
<body style="background: whitesmoke;"> | ||
<polymer-ui-arrow direction="up"></polymer-ui-arrow> | ||
<br><br> | ||
<polymer-ui-arrow direction="down" size="20" color="whitesmoke" borderWidth="8"></polymer-ui-arrow> | ||
<br><br> | ||
<polymer-ui-arrow direction="right" size="30" color="blue" borderColor="lightblue" borderWidth="6"></polymer-ui-arrow> | ||
<br><br> | ||
<polymer-ui-arrow direction="left" color="#aaa" borderColor="#aaa"></polymer-ui-arrow> | ||
</body> | ||
</html> |
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,20 @@ | ||
@host { | ||
* { | ||
display: inline-block; | ||
position: relative; | ||
overflow: hidden; | ||
} | ||
|
||
[hidden], .hidden { | ||
display: none; | ||
} | ||
} | ||
|
||
.arrow { | ||
border-color: transparent; | ||
border-style: solid; | ||
} | ||
|
||
.arrow-inner { | ||
position: absolute; | ||
} |
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,79 @@ | ||
<!-- | ||
Copyright 2013 The Polymer Authors. All rights reserved. | ||
Use of this source code is governed by a BSD-style | ||
license that can be found in the LICENSE file. | ||
--> | ||
<!-- | ||
/** | ||
* @module Polymer UI Elements | ||
*/ | ||
/** | ||
* @class polymer-ui-arrow | ||
*/ | ||
--> | ||
<polymer-element name="polymer-ui-arrow" attributes="direction size color borderColor borderWidth"> | ||
<template> | ||
<link rel="stylesheet" href="polymer-ui-arrow.css"> | ||
<div id="outer" class="arrow arrow-outer" style="border-width: {{size}}px;"></div> | ||
<div id="inner" class="arrow arrow-inner" style="border-width: {{size}}px;"></div> | ||
</template> | ||
<script> | ||
Polymer('polymer-ui-arrow', { | ||
borders: { | ||
up: 'Bottom', | ||
down: 'Top', | ||
left: 'Right', | ||
right: 'Left' | ||
}, | ||
tops: { | ||
up: 1, | ||
down: -1, | ||
left: 0, | ||
right: 0 | ||
}, | ||
lefts: { | ||
up: 0, | ||
down: 0, | ||
left: 1, | ||
right: -1 | ||
}, | ||
direction: 'up', | ||
size: 10, | ||
color: '#fff', | ||
borderColor: '#ccc', | ||
borderWidth: 1, | ||
ready: function() { | ||
this.asyncUpdate(); | ||
}, | ||
directionChanged: function() { | ||
this.asyncUpdate(); | ||
}, | ||
sizeChanged: function() { | ||
this.asyncUpdate(); | ||
}, | ||
colorChanged: function() { | ||
this.asyncUpdate(); | ||
}, | ||
borderColorChanged: function() { | ||
this.asyncUpdate(); | ||
}, | ||
borderWidthChanged: function() { | ||
this.asyncUpdate(); | ||
}, | ||
asyncUpdate: function() { | ||
this.updateJob = this.job(this.updateJob, this.update, 1); | ||
}, | ||
update: function() { | ||
var os = this.$.outer.style; | ||
var is = this.$.inner.style; | ||
os.borderColor = 'transparent'; | ||
is.borderColor = 'transparent'; | ||
var bc = 'border' + this.borders[this.direction] + 'Color'; | ||
os[bc] = this.borderColor; | ||
is[bc] = this.color; | ||
is.top = this.tops[this.direction] * this.borderWidth + 'px'; | ||
is.left = this.lefts[this.direction] * this.borderWidth + 'px'; | ||
} | ||
}); | ||
</script> | ||
</polymer-element> |
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
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
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
Oops, something went wrong.