Introducing Pillar Framework
Refactor of pillar-server and pillar-web into a single python package. This simplifies the overall architecture of pillar applications. Special thanks @sybren and @venomgfx
This commit is contained in:
15
src/scripts/tutti/3_project-utils.js
Normal file
15
src/scripts/tutti/3_project-utils.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// Util to handle project, node and parent properties
|
||||
ProjectUtils = {
|
||||
nodeId: function() { return document.body.dataset.nodeId; },
|
||||
parentNodeId: function() { return document.body.dataset.parentNodeId; },
|
||||
projectId: function() { return document.body.dataset.projectId; },
|
||||
isProject: function() { return document.body.dataset.isProject === 'true'; },
|
||||
nodeType: function() { return document.body.dataset.nodeType; },
|
||||
isModified: function() { return document.body.dataset.isModified === 'true'; },
|
||||
setProjectAttributes: function(props) {
|
||||
for (var key in props) {
|
||||
if (!props.hasOwnProperty(key)) continue;
|
||||
document.body.dataset[key] = props[key];
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user