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

Commit

Permalink
polymer-ui-tabs; use Platform.flush instead of dirtyCheck; cleanup
Browse files Browse the repository at this point in the history
workbench files
  • Loading branch information
frankiefu committed Jun 12, 2013
1 parent 4823d30 commit 1812da5
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 17 deletions.
20 changes: 10 additions & 10 deletions polymer-ui-menu/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@
<body class="polymer-ui-body-text">
<h2>polymer-ui-dark-theme</h2>
<polymer-ui-menu selected="0" theme="polymer-ui-dark-theme">
<polymer-ui-menu-item icon="settings">Settings</polymer-ui-menu-item>
<polymer-ui-menu-item icon="dialog">Dialog</polymer-ui-menu-item>
<polymer-ui-menu-item icon="search">Search</polymer-ui-menu-item>
<polymer-ui-menu-item icon="settings" label="Settings"></polymer-ui-menu-item>
<polymer-ui-menu-item icon="dialog" label="Dialog"></polymer-ui-menu-item>
<polymer-ui-menu-item icon="search" label="Search"></polymer-ui-menu-item>
</polymer-ui-menu>
<h2>polymer-ui-light-theme</h2>
<polymer-ui-menu selected="0" theme="polymer-ui-light-theme">
<polymer-ui-menu-item icon="settings">Settings</polymer-ui-menu-item>
<polymer-ui-menu-item icon="dialog">Dialog</polymer-ui-menu-item>
<polymer-ui-menu-item icon="search">Search</polymer-ui-menu-item>
<polymer-ui-menu-item icon="settings" label="Settings"></polymer-ui-menu-item>
<polymer-ui-menu-item icon="dialog" label="Dialog"></polymer-ui-menu-item>
<polymer-ui-menu-item icon="search" label="Search"></polymer-ui-menu-item>
</polymer-ui-menu>
<h2>polymer-ui-light-theme (no icons)</h2>
<h2>polymer-ui-dark-theme (no icons)</h2>
<polymer-ui-menu selected="0" theme="polymer-ui-dark-theme">
<polymer-ui-menu-item>Settings</polymer-ui-menu-item>
<polymer-ui-menu-item>Dialog</polymer-ui-menu-item>
<polymer-ui-menu-item>Search</polymer-ui-menu-item>
<polymer-ui-menu-item label="Settings"></polymer-ui-menu-item>
<polymer-ui-menu-item label="Dialog"></polymer-ui-menu-item>
<polymer-ui-menu-item label="Search"></polymer-ui-menu-item>
</polymer-ui-menu>
</body>
</html>
5 changes: 2 additions & 3 deletions polymer-ui-ratings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
<script src="../../polymer/polymer.js"></script>
<!-- import elements-->
<link rel="import" href="polymer-ui-ratings.html">
<!-- -->
<link rel="stylesheet" href="../basic.css">
</head>
<body>
<polymer-ui-ratings value="3"></polymer-ui-ratings>
</div>
<br><br>
<polymer-ui-ratings value="5" count="10"></polymer-ui-ratings>
</body>
</html>
29 changes: 29 additions & 0 deletions polymer-ui-tabs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

<!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>polymer-ui-tabs</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- load toolkit -->
<script src="../../polymer/polymer.js"></script>
<!-- import elements-->
<link rel="import" href="polymer-ui-tabs.html">
<!-- -->
<link rel="stylesheet" href="../basic.css">
</head>
<body class="polymer-ui-body-text">
<polymer-ui-tabs selected="0">
<span>One</span>
<span>Two</span>
<span>Three</span>
<span>Four</span>
<span>Five</span>
</polymer-ui-tabs>
</body>
</html>
65 changes: 65 additions & 0 deletions polymer-ui-tabs/polymer-ui-tabs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!--
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
*/
/**
* polymer-ui-tabs is a g-selector styled to look like a tab menu.
*
* Example:
*
* <polymer-ui-tabs selected="0">
* <span>One</span>
* <span>Two</span>
* <span>Three</span>
* <span>Four</span>
* </polymer-ui-tabs>
*
* @class polymer-ui-tabs
* @extends g-selector
*/
-->
<link rel="import" href="../../polymer-elements/polymer-selector/polymer-selector.html">

<element name="polymer-ui-tabs" extends="polymer-selector">
<template>
<style>
@host {
* {
display: block;
height: 59px;
border: 0;
border-bottom: 1px solid #e8e8e8;
white-space: nowrap;
}
}

/*@polyfill @host > * */
::-webkit-distributed(*) {
display: inline-block;
min-width: 60px;
height: 59px;
line-height: 59px;
text-align: center;
padding: 0 8px;
cursor: pointer;
font-size: 14px;
color: #999;
}

/*@polyfill @host > *.polymer-selected */
::-webkit-distributed(*.polymer-selected) {
background: #4888f0;
color: #fff;
}
</style>
<shadow></shadow>
</template>
<script>
Polymer.register(this);
</script>
</element>
5 changes: 3 additions & 2 deletions polymer-ui-toggle-button/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
<!-- -->
<link rel="stylesheet" href="../basic.css">
</head>
<body>
<body class="polymer-ui-body-text">
<polymer-ui-toggle-button></polymer-ui-toggle-button>
</div>
<br><br>
<polymer-ui-toggle-button value="true"></polymer-ui-toggle-button>
</body>
</html>
4 changes: 2 additions & 2 deletions polymer-ui-toggle-button/polymer-ui-toggle-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@
this.$.toggle.style.left = null;
this.$.toggle.classList.remove('dragging');
this.value = Math.abs(this.x) < this.w / 2;
dirtyCheck();
Platform.flush();
},
flick: function(e) {
this.value = e.xVelocity > 0;
dirtyCheck();
Platform.flush();
}
});
</script>
Expand Down

0 comments on commit 1812da5

Please sign in to comment.