Cobbled together some semblance of an item library UI
This commit is contained in:
29
app/client/views/library/library.js
Normal file
29
app/client/views/library/library.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const librarySubs = new SubsManager();
|
||||
|
||||
Template.library.onCreated(function(){
|
||||
this.selectedTab = new ReactiveVar("0");
|
||||
});
|
||||
|
||||
Template.library.helpers({
|
||||
selectedTab(){
|
||||
return Template.instance().selectedTab.get();
|
||||
},
|
||||
});
|
||||
|
||||
Template.library.events({
|
||||
"iron-select #libraryTabs": function(event, instance){
|
||||
instance.selectedTab.set(event.target.selected);
|
||||
},
|
||||
"click #addLibrary": function(event, instance){
|
||||
var libraryId = Libraries.insert({
|
||||
name: "New Library",
|
||||
owner: Meteor.userId(),
|
||||
});
|
||||
pushDialogStack({
|
||||
template: "libraryDialog",
|
||||
data: {libraryId},
|
||||
element: event.currentTarget,
|
||||
returnElement: () => instance.find(`.library-header[data-id='${libraryId}']`),
|
||||
});
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user