Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
67 lines
1.4 KiB
JavaScript
Executable file
67 lines
1.4 KiB
JavaScript
Executable file
/* global define */
|
|
;(function(define){'use strict';define(function(require,exports,module){
|
|
|
|
/**
|
|
* Dependencies
|
|
*/
|
|
|
|
var GaiaDialogProto = require('gaia-dialog').prototype;
|
|
var component = require('gaia-component');
|
|
|
|
/**
|
|
* Exports
|
|
*/
|
|
module.exports = component.register('gaia-dialog-alert', {
|
|
created: function() {
|
|
this.setupShadowRoot();
|
|
this.els = {
|
|
dialog: this.shadowRoot.querySelector('gaia-dialog')
|
|
};
|
|
this.els.dialog.addEventListener('closed',
|
|
GaiaDialogProto.hide.bind(this));
|
|
},
|
|
|
|
open: function(e) {
|
|
return GaiaDialogProto.show.call(this)
|
|
.then(() => this.els.dialog.open(e));
|
|
},
|
|
|
|
close: function() {
|
|
return this.els.dialog.close()
|
|
.then(GaiaDialogProto.hide.bind(this));
|
|
},
|
|
|
|
template: `
|
|
<gaia-dialog>
|
|
<section>
|
|
<p><content></content></p>
|
|
</section>
|
|
<div>
|
|
<button class="submit primary" on-click="close">Ok</button>
|
|
</div>
|
|
</gaia-dialog>
|
|
|
|
<style>
|
|
|
|
:host {
|
|
display: none;
|
|
position: fixed;
|
|
left: 0;
|
|
top: 0;
|
|
z-index: 999;
|
|
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
gaia-dialog section {
|
|
max-width: 320px;
|
|
}
|
|
|
|
</style>`
|
|
});
|
|
|
|
});})(typeof define=='function'&&define.amd?define
|
|
:(function(n,w){'use strict';return typeof module=='object'?function(c){
|
|
c(require,exports,module);}:function(c){var m={exports:{}};c(function(n){
|
|
return w[n];},m.exports,m);w[n]=m.exports;};})('gaia-dialog-alert',this));
|