Implement OCSP stapling in Windows BoringSSL port.
[chromium-blink-merge.git] / third_party / polymer / components-chromium / core-splitter / core-splitter-extracted.js
blob32135ab2cee5677c21b28ad07e2519f51f817407
3 Polymer('core-splitter', {
5 /**
6 * Possible values are "left", "right", "up" and "down".
8 * @attribute direction
9 * @type string
10 * @default 'left'
12 direction: 'left',
14 /**
15 * Minimum width to which the splitter target can be sized
17 * @attribute minSize
18 * @type number
19 * @default 0
21 minSize: 0,
23 /**
24 * Locks the split bar so it can't be dragged.
26 * @attribute locked
27 * @type boolean
28 * @default false
30 locked: false,
32 /**
33 * By default the parent and siblings of the splitter are set to overflow hidden. This helps
34 * avoid elements bleeding outside the splitter regions. Set this property to true to allow
35 * these elements to overflow.
37 * @attribute allowOverflow
38 * @type boolean
39 * @default false
41 allowOverflow: false,
43 ready: function() {
44 this.directionChanged();
47 domReady: function() {
48 if (!this.allowOverflow) {
49 this.parentNode.style.overflow = this.nextElementSibling.style.overflow =
50 this.previousElementSibling.style.overflow = 'hidden';
54 directionChanged: function() {
55 this.isNext = this.direction === 'right' || this.direction === 'down';
56 this.horizontal = this.direction === 'up' || this.direction === 'down';
57 this.update();
60 update: function() {
61 this.target = this.isNext ? this.nextElementSibling : this.previousElementSibling;
62 this.dimension = this.horizontal ? 'height' : 'width';
63 this.classList.toggle('horizontal', this.horizontal);
66 targetChanged: function(old) {
67 if (old) {
68 old.style[old.__splitterMinSize] = '';
70 var min = this.target.__splitterMinSize = this.horizontal ? 'minHeight' : 'minWidth';
71 this.target.style[min] = this.minSize + 'px';
74 trackStart: function() {
75 this.update();
76 this.size = parseInt(getComputedStyle(this.target)[this.dimension]);
79 track: function(e) {
80 if (this.locked) {
81 return;
83 var d = e[this.horizontal ? 'dy' : 'dx'];
84 this.target.style[this.dimension] =
85 this.size + (this.isNext ? -d : d) + 'px';
88 preventSelection: function(e) {
89 e.preventDefault();
91 });