| <link rel="import" href="../../../third-party/polymer/polymer.html"> |
| <link rel="import" href="../../../third-party/paper-checkbox/paper-checkbox.html"> |
| <polymer-element name="p2b-plugin-console"> |
| <link rel="stylesheet" href="component.css"> |
| <link rel="stylesheet" href="../../../libs/css/common-style.css"> |
| <div title="Auto Scroll" class="auto-scroll {{ {hidden : !scrolling} | tokenList}}"> |
| <paper-checkbox checked="{{autoScroll}}" label="Auto Scroll" id="autoscroll"></paper-checkbox> |
| Polymer('p2b-plugin-console', { |
| requestAnimationFrame(function() { |
| if (this.textBuffer.length === 0) { |
| var textNode = document.createTextNode(this.textBuffer.join('')); |
| this.$.console.appendChild(textNode); |
| var scrollTop = this.scrollTop; |
| this.scrolling = scrollTop > 0; |
| this.scrollTop = this.scrollHeight; |
| * Appends text to the console |
| * @param {string} text Text to add |
| addText: function(text) { |
| this.textBuffer.push(text); |