| OLD | NEW |
| (Empty) |
| 1 /** | |
| 2 * @license | |
| 3 * Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
| 4 * This code may only be used under the BSD style license found at http://polyme
r.github.io/LICENSE.txt | |
| 5 * The complete set of authors may be found at http://polymer.github.io/AUTHORS.
txt | |
| 6 * The complete set of contributors may be found at http://polymer.github.io/CON
TRIBUTORS.txt | |
| 7 * Code distributed by Google as part of the polymer project is also | |
| 8 * subject to an additional IP rights grant found at http://polymer.github.io/PA
TENTS.txt | |
| 9 */ | |
| 10 (function(global) { | |
| 11 | |
| 12 global.flushAsynchronousOperations = function() { | |
| 13 // force distribution | |
| 14 Polymer.dom.flush(); | |
| 15 // force lifecycle callback to fire on polyfill | |
| 16 window.CustomElements && window.CustomElements.takeRecords(); | |
| 17 }; | |
| 18 | |
| 19 global.forceXIfStamp = function(node) { | |
| 20 var templates = Polymer.dom(node.root).querySelectorAll('template[is=dom-if]
'); | |
| 21 for (var tmpl, i = 0; tmpl = templates[i]; i++) { | |
| 22 tmpl.render(); | |
| 23 } | |
| 24 | |
| 25 global.flushAsynchronousOperations(); | |
| 26 }; | |
| 27 | |
| 28 global.fireEvent = function(type, props, node) { | |
| 29 var event = new CustomEvent(type, { | |
| 30 bubbles: true, | |
| 31 cancelable: true | |
| 32 }); | |
| 33 for (p in props) { | |
| 34 event[p] = props[p]; | |
| 35 } | |
| 36 node.dispatchEvent(event); | |
| 37 }; | |
| 38 | |
| 39 })(this); | |
| OLD | NEW |