| <html> |
| <head> |
| <title>filter-dialog-sk demo</title> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> |
| <script src="../../node_modules/native-promise-only/npo.js"></script> |
| <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script> |
| <script src="../common/js/common.js"></script> |
| <script src="../js/gold.js"></script> |
| <script src="testdata.js"></script> |
| |
| <link rel="import" href="bower_components/polymer/polymer.html"> |
| <link rel="import" href="filter-dialog-sk.html"> |
| <link rel="import" href="bower_components/paper-button/paper-button.html"> |
| |
| </head> |
| <body> |
| <h1>filter-dialog-sk demo</h1> |
| |
| <dom-module id="main-document-element"> |
| <template> |
| <filter-dialog-sk id="filterDialog"></filter-dialog-sk> |
| <paper-button on-tap="_handleClick" raised>Open Dialog</paper-button> |
| <br><br> |
| Selection: "{{_selection}}" |
| </template> |
| |
| <script> |
| HTMLImports.whenReady(function () { |
| Polymer({ |
| is: 'main-document-element', |
| |
| properties: { |
| _selection: { |
| type: String, |
| value: '' |
| } |
| }, |
| |
| ready: function() { |
| var filter = { |
| metric: "combined", |
| frgbamax: 0, |
| frgbamax: 255, |
| fdiffmax: -1, |
| fgrouptest: "", |
| match: ["name", "gamma_correct"], |
| fref: false, |
| fbegin: 'e1fce93f36d7b73df9942135dc5a342b629e6b3a', |
| fend: '4528c867c4ba65fdf5cfd6de35ea4c36a16c73f6', |
| }; |
| this._currSelection = filter; |
| this.$.filterDialog.setParamSet(testdata.paramSet); |
| this.$.filterDialog.setCommitInfo(testdata.commits); |
| this.listen(this.$.filterDialog, 'edit', '_handleEditEvent'); |
| }, |
| |
| _handleClick: function() { |
| this.$.filterDialog.setValue(this._currSelection); |
| this.$.filterDialog.open(this._selection); |
| }, |
| |
| _handleEditEvent: function(ev) { |
| this._currSelection = ev.detail; |
| this._selection=sk.query.fromObject(ev.detail); |
| } |
| }); |
| }); |
| </script> |
| </dom-module> |
| |
| <!-- Instantite the element defined above --> |
| <main-document-element></main-document-element> |
| |
| </body> |
| </html> |