an ability to create panes actions, player frontend draft
This commit is contained in:
parent
c8b432fe57
commit
ec349d9bb4
16 changed files with 304 additions and 28 deletions
|
@ -231,6 +231,9 @@
|
|||
"_onWindowResize": function() {
|
||||
this._body.setSize(document.body.offsetWidth, document.body.offsetHeight);
|
||||
},
|
||||
"play": function(id) {
|
||||
console.log("Need to play " + id.toString());
|
||||
},
|
||||
"_prepareNode": function(name, address, port) {
|
||||
if (this._nodes[name]) {
|
||||
throw new Error("An attempt to prepeare node " + name + " for the second time");
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
window.unregisterForeignController = window.lorgar.unregisterForeignController.bind(window.lorgar);
|
||||
window.subscribeForeignController = window.lorgar.subscribeForeignController.bind(window.lorgar);
|
||||
window.unsubscribeForeignController = window.lorgar.unsubscribeForeignController.bind(window.lorgar);
|
||||
window.play = window.lorgar.play.bind(window.lorgar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,11 @@
|
|||
|
||||
controller.on("setEnabled", this._onSetEnabled, this);
|
||||
controller.on("setLabel", this._onSetLabel, this);
|
||||
|
||||
if (controller.initialized) {
|
||||
this._onSetEnabled(controller.enabled);
|
||||
this._onSetLabel(controller.hasLabel, controller.label);
|
||||
}
|
||||
},
|
||||
"destructor": function() {
|
||||
this._f.off("setEnabled", this._onSetEnabled, this);
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
defineArray.push("views/layout");
|
||||
defineArray.push("views/label");
|
||||
defineArray.push("views/image");
|
||||
defineArray.push("views/button");
|
||||
defineArray.push("lib/wController/localModel");
|
||||
|
||||
define(moduleName, defineArray, function() {
|
||||
|
@ -15,6 +16,7 @@
|
|||
var Layout = require("views/layout");
|
||||
var Label = require("views/label");
|
||||
var Image = require("views/image");
|
||||
var Button = require("views/button");
|
||||
var LM = require("lib/wController/localModel");
|
||||
|
||||
var Pane = Layout.inherit({
|
||||
|
@ -46,6 +48,12 @@
|
|||
|
||||
this._f.on("newElement", this._onNewElement, this);
|
||||
this._f.on("removeElement", this._onRemoveElement, this);
|
||||
this._f.on("addAction", this._onAddAction, this);
|
||||
|
||||
var acts = this._f.getActions();
|
||||
for (var i = 0; i < acts.length; ++i) {
|
||||
this._onAddAction(acts[i]);
|
||||
}
|
||||
|
||||
this._uncyclic.push(function() {
|
||||
lm.destructor();
|
||||
|
@ -56,6 +64,10 @@
|
|||
|
||||
Layout.fn.destructor.call(this);
|
||||
},
|
||||
"_onAddAction": function(model) {
|
||||
var view = new Button(model);
|
||||
this.append(view, Layout.Aligment.LeftTop)
|
||||
},
|
||||
"_applyProperties": function() {
|
||||
this._onAddProperty("secondaryColor", "background");
|
||||
|
||||
|
@ -67,8 +79,8 @@
|
|||
};
|
||||
},
|
||||
"_onClick": function() {
|
||||
if (this._f.data.at("hasPageLink").valueOf() === true) {
|
||||
this.trigger("activate", this._f.data.at("pageLink").clone());
|
||||
if (this._f.hasPageLink()) {
|
||||
this.trigger("activate", this._f.getPageLink());
|
||||
}
|
||||
},
|
||||
"_onLabelChangeLimits": function(label) {
|
||||
|
|
|
@ -50,15 +50,13 @@
|
|||
this._f.setSubscriptionRange(0, 0);
|
||||
},
|
||||
"append": function(child, index) {
|
||||
var model = new LM();
|
||||
var nest = new Layout(model, {
|
||||
var nest = new Layout(helper, {
|
||||
minHeight: this._o.nestHeight,
|
||||
maxHeight: this._o.nestHeight,
|
||||
minWidth: this._o.nestWidth,
|
||||
minWidth: this._o.nestWidth,
|
||||
scrollable: Layout.Scroll.None
|
||||
});
|
||||
nest._uncyclic.push(function() {model.destructor()});
|
||||
nest.append(child);
|
||||
child.on("activate", this._onChildActivate, this); //todo need to remove handler on deletion
|
||||
this._addChild(nest, 0, index);
|
||||
|
@ -184,6 +182,8 @@
|
|||
}
|
||||
});
|
||||
|
||||
var helper = new LM();
|
||||
|
||||
return PanesList;
|
||||
});
|
||||
})();
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
deps.push("views/gridLayout");
|
||||
deps.push("views/button");
|
||||
deps.push("views/label");
|
||||
deps.push("views/view");
|
||||
|
||||
deps.push("lib/wController/localModel");
|
||||
|
||||
|
@ -15,6 +16,7 @@
|
|||
var GridLayout = require("views/gridLayout");
|
||||
var Button = require("views/button");
|
||||
var Label = require("views/label");
|
||||
var View = require("views/view");
|
||||
|
||||
var Model = require("lib/wController/localModel");
|
||||
|
||||
|
@ -38,10 +40,12 @@
|
|||
var artist = new Label(this._infoModels.artist);
|
||||
var album = new Label(this._infoModels.album);
|
||||
var song = new Label(this._infoModels.song);
|
||||
var spacer = new View(helper);
|
||||
|
||||
this.append(artist, 0, 2, 1, 1)
|
||||
this.append(song, 1, 2, 1, 1)
|
||||
this.append(album, 2, 2, 1, 1)
|
||||
this.append(spacer, 0, 3, 3, 1);
|
||||
|
||||
this._uncyclic.push(this._infoModels.artist.destructor.bind(this._infoModels.artist));
|
||||
this._uncyclic.push(this._infoModels.song.destructor.bind(this._infoModels.song));
|
||||
|
@ -94,6 +98,8 @@
|
|||
}
|
||||
});
|
||||
|
||||
var helper = new Model();
|
||||
|
||||
return Player;
|
||||
});
|
||||
})()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue