Plugin popup() api

Changes to JS API:
- popups have backdrop and is centered
- plugin.popup() takes a string custom element name
- plugin.popup() returns an API for closing and reopening the popup
- plugin.deprecated.popup() takes Element (similar to GWT Plugin JS API)

Recommended usage:

``` js
  Gerrit.install(function(plugin) {
    const popup = plugin.popup('my-plugin-popup-simple');;
    // ... work
    popup.close();
    // ... more work
    popup.open();
  });

```

``` html
<dom-module id="my-plugin-popup-simple">
  <template>
    <div>popup popup popup popup popup </div>
  </template>
  <script>
    Polymer({is: 'my-plugin-popup-simple'});
  </script>
</dom-module>
```

Change-Id: Icb3f83d35f3c60915f12b77bc8a7d548d50d5695
This commit is contained in:
Viktar Donich
2017-08-04 09:48:19 -07:00
parent ab491f77a0
commit 2f3ee89d02
13 changed files with 391 additions and 3 deletions

View File

@@ -27,13 +27,15 @@ const EXTERN_NAMES = [
'GrGerritAuth',
'GrLinkTextParser',
'GrPluginEndpoints',
'GrPopupInterface',
'GrRangeNormalizer',
'GrReporting',
'GrReviewerUpdatesParser',
'GrThemeApi',
'moment',
'page',
'util'];
'util',
];
fs.readdir('./polygerrit-ui/temp/behaviors/', (err, data) => {
if (err) {
@@ -102,4 +104,4 @@ fs.readdir('./polygerrit-ui/temp/behaviors/', (err, data) => {
process.exit(1);
}
});
});
});