diff --git a/src/browser/js/app/editor/init.js b/src/browser/js/app/editor/init.js
index e01fe907..5309be79 100644
--- a/src/browser/js/app/editor/init.js
+++ b/src/browser/js/app/editor/init.js
@@ -1,6 +1,6 @@
var {updateWidget, incrementWidget} = require('./data-workers'),
{editObject, editClean} = require('./edit-objects'),
- Popup = require('../ui/popup'),
+ {Popup} = require('../ui/utils'),
{widgets, categories} = require('../widgets/'),
widgetManager = require('../managers/widgets'),
ContextMenu = require('./context-menu')
diff --git a/src/browser/js/app/ipc/callbacks.js b/src/browser/js/app/ipc/callbacks.js
index 65bad090..1d4b8052 100644
--- a/src/browser/js/app/ipc/callbacks.js
+++ b/src/browser/js/app/ipc/callbacks.js
@@ -60,7 +60,7 @@ var callbacks = module.exports = {
},
error: function(data){
- utils.createPopup(utils.icon('warning') + ' Error', data, true)
+ new utils.Poup({title: utils.icon('warning') + ' Error', content: data, closable:true})
},
reloadCss: function(){
diff --git a/src/browser/js/app/managers/session.js b/src/browser/js/app/managers/session.js
index b9c4c98a..84f9d6c5 100644
--- a/src/browser/js/app/managers/session.js
+++ b/src/browser/js/app/managers/session.js
@@ -2,9 +2,8 @@ var ipc = require('../ipc/'),
parser = require('../parser'),
state = require('./state'),
editor = require('../editor/'),
- Popup = require('../ui/popup'),
lobby = require('../ui/lobby'),
- {loading, icon} = require('../ui/utils'),
+ {loading, icon, Popup} = require('../ui/utils'),
{saveAs} = require('file-saver')
diff --git a/src/browser/js/app/ui/popup.js b/src/browser/js/app/ui/popup.js
deleted file mode 100644
index 1e455c48..00000000
--- a/src/browser/js/app/ui/popup.js
+++ /dev/null
@@ -1,60 +0,0 @@
-var {icon} = require('./utils')
-
-module.exports = class Popup {
-
- constructor(options) {
-
- this.closable = options.closable
- this.escKey = options.closable || options.escKey
- this.enterKey = options.enterKey
- this.content = options.content
- this.title = options.title
-
- this.html = DOM.create(`
-
- `)
-
- if (this.closable) {
- DOM.get(this.html, '.popup-title .closer')[0].addEventListener('fake-click', ()=>{
- this.close()
- })
- }
-
- if (this.escKey) {
- this.escKeyHandler = ((e)=>{
- if (e.keyCode==27) this.close()
- }).bind(this)
- }
-
- if (this.enterKey) {
- this.enterKeyHandler = ((e)=>{
- if (e.keyCode == 13) this.enterKey.call(this, e)
- }).bind(this)
- }
-
- this.open()
-
-
- }
-
-
-
- close() {
- if (this.escKey) document.removeEventListener('keydown', this.escKeyHandler)
- if (this.enterKey) document.removeEventListener('keydown', this.enterKeyHandler)
- document.body.removeChild(this.html)
- }
-
- open() {
- if (this.escKey) document.addEventListener('keydown', this.escKeyHandler)
- if (this.enterKey) document.addEventListener('keydown', this.enterKeyHandler)
- document.body.appendChild(this.html)
- }
-}
diff --git a/src/browser/js/app/ui/utils.js b/src/browser/js/app/ui/utils.js
index 6ff4785a..48a23ddc 100644
--- a/src/browser/js/app/ui/utils.js
+++ b/src/browser/js/app/ui/utils.js
@@ -1,9 +1,66 @@
-var Popup = require('./popup')
-
module.exports = {
+ Popup: class Popup {
+
+ constructor(options) {
+
+ this.closable = options.closable
+ this.escKey = options.closable || options.escKey
+ this.enterKey = options.enterKey
+ this.content = options.content
+ this.title = options.title
+
+ this.html = DOM.create(`
+
+ `)
+
+ if (this.closable) {
+ DOM.get(this.html, '.popup-title .closer')[0].addEventListener('fake-click', ()=>{
+ this.close()
+ })
+ }
+
+ if (this.escKey) {
+ this.escKeyHandler = ((e)=>{
+ if (e.keyCode==27) this.close()
+ }).bind(this)
+ }
+
+ if (this.enterKey) {
+ this.enterKeyHandler = ((e)=>{
+ if (e.keyCode == 13) this.enterKey.call(this, e)
+ }).bind(this)
+ }
+
+ this.open()
+
+
+ }
+
+
+
+ close() {
+ if (this.escKey) document.removeEventListener('keydown', this.escKeyHandler)
+ if (this.enterKey) document.removeEventListener('keydown', this.enterKeyHandler)
+ document.body.removeChild(this.html)
+ }
+
+ open() {
+ if (this.escKey) document.addEventListener('keydown', this.escKeyHandler)
+ if (this.enterKey) document.addEventListener('keydown', this.enterKeyHandler)
+ document.body.appendChild(this.html)
+ }
+ },
+
loading: function(title){
- return new Popup({
+ return new module.exports.Popup({
title: title,
content: '',
closable: false