-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
391 additions
and
91 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.md] | ||
indent_style = space | ||
indent_size = 4 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>chrome-tabs demo</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> | ||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script> | ||
|
||
<link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html"> | ||
<link rel="import" href="../../iron-demo-helpers/demo-snippet.html"> | ||
|
||
<link rel="import" href="../chrome-tabs.html"> | ||
<link rel="import" href="../chrome-tab.html"> | ||
<link rel="import" href="../../iron-pages/iron-pages.html"> | ||
|
||
<style is="custom-style" include="demo-pages-shared-styles"> | ||
.centered { | ||
max-width:90%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<template is="dom-bind" id="demo"> | ||
<style is="custom-style"> | ||
.content { | ||
height: 100px; | ||
padding: 10px; | ||
box-sizing: border-box; | ||
border: 1px solid lightgray; | ||
border-top: none; | ||
background: white; | ||
} | ||
iron-pages { | ||
height: 100px; | ||
background: gainsboro; | ||
} | ||
|
||
</style> | ||
<chrome-tabs selected="{{selected}}" extendable id="tabs"> | ||
<chrome-tab unclosable icon="https://www.polymer-project.org/images/logos/p-logo-32.png" title="Tab title"></chrome-tab> | ||
<chrome-tab icon="https://assets-cdn.github.com/favicon.ico" title="Tab title"></chrome-tab> | ||
<chrome-tab | ||
icon='https://www.google.fr/images/branding/product/ico/googleg_lodp.ico' | ||
title="Google"></chrome-tab> | ||
<chrome-tab title="Tab title"></chrome-tab> | ||
</chrome-tabs> | ||
<script> | ||
const demo = document.querySelector('#demo'); | ||
demo.selected = 1; | ||
demo.$.tabs.addEventListener('tab-remove', evt => { | ||
const tab = demo.$.tabs.items[evt.detail.index]; | ||
Polymer.dom(demo.$.tabs).removeChild(tab); | ||
}); | ||
|
||
demo.$.tabs.addEventListener('tab-add', () => { | ||
let newTab = document.createElement('chrome-tab'); | ||
newTab.icon = ''; | ||
newTab.title = 'about:blank'; | ||
Polymer.dom(demo.$.tabs).appendChild(newTab); | ||
}); | ||
</script> | ||
</template> | ||
</body> | ||
</html> |
Oops, something went wrong.