refactor 3-more into separate books

This commit is contained in:
Ilya Kantor 2015-02-27 13:21:58 +03:00
parent bd1d5e4305
commit 87639b2740
423 changed files with 9 additions and 9 deletions

View file

@ -0,0 +1,56 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="import" href="jquery.html">
</head>
<body>
<template id="tmpl">
<style>
@import url(http://code.jquery.com/ui/1.11.3/themes/ui-lightness/jquery-ui.css);
:host {
display: block;
}
</style>
<div id="slider"></div>
</template>
<script>
!function() {
var localDocument = document.currentScript.ownerDocument;
var tmpl = localDocument.getElementById('tmpl');
var SliderProto = Object.create(HTMLElement.prototype);
SliderProto.createdCallback = function() {
var root = this.createShadowRoot();
root.appendChild(tmpl.content.cloneNode(true));
this.$slider = $(root.getElementById('slider'));
var self = this;
this.$slider.slider({
min: +this.getAttribute('min') || 0,
max: +this.getAttribute('max') || 100,
value: this.getAttribute('value') || 0,
slide: function() {
var event = new CustomEvent("slide", {
detail: { value: self.$slider.slider("option", "value") },
bubbles: true
});
self.dispatchEvent(event);
}
});
};
document.registerElement('ui-slider', {
prototype: SliderProto
});
}();
</script>
</body>
</html>