mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-24 02:27:37 +00:00
Register windows by name
This commit is contained in:
parent
2425b7aec8
commit
ea060500cf
2 changed files with 7 additions and 3 deletions
|
|
@ -51,8 +51,8 @@ Winamp = {
|
|||
_registerListeners: function() {
|
||||
var self = this;
|
||||
|
||||
this.windowManager.registerWindow(this.mainWindow);
|
||||
this.windowManager.registerWindow(this.playlistWindow);
|
||||
this.windowManager.registerWindow('main', this.mainWindow);
|
||||
this.windowManager.registerWindow('playlist', this.playlistWindow);
|
||||
|
||||
this.media.addEventListener('timeupdate', function() {
|
||||
window.dispatchEvent(self.events.timeUpdated);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
WindowManager = {
|
||||
registerWindow: function(win) {
|
||||
windows: {},
|
||||
registerWindow: function(name, win) {
|
||||
var self = this;
|
||||
var body = win.body;
|
||||
var handle = win.handle;
|
||||
var resizeHandle = win.resizeHandle;
|
||||
|
||||
this.windows[name] = body;
|
||||
|
||||
// Make window dragable
|
||||
handle.addEventListener('mousedown',function(e){
|
||||
if(e.target.classList.contains('ui')) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue