roar/assets/js/ui/custom.js
Lucio Andrés Illanes Albornoz 0080b3cb6b Refactor & clean up repository tree.
2018-11-26 10:23:26 +01:00

30 lines
629 B
JavaScript

var custom = (function(){
var exports = {}
exports.clone = function (){
var new_brush = brush.clone()
var rapper = document.createElement("div")
rapper.className = "custom"
new_brush.append(rapper)
custom_rapper.appendChild(rapper)
// store in localstorage?
rapper.addEventListener("click", function(e){
if (e.shiftKey) {
rapper.parentNode.removeChild(rapper)
delete new_brush
} else {
// load this brush
exports.load(new_brush)
}
})
}
exports.load = function(new_brush){
brush.assign( new_brush )
}
return exports
})()