Sha256: 6f05fba889636d2054a5fd2422a604510b47125ec9b68bea35c83c4303186ec1
Contents?: true
Size: 1.23 KB
Versions: 6
Compression:
Stored size: 1.23 KB
Contents
rbbt.aesthetics = {LS_key: "rbbt.aesthetics"} var aes_module = rbbt.aesthetics aes_module.load = function(){ this.aesthetics = rbbt.LS.load(this.LS_key) if (undefined === this.aesthetics) this.aesthetics = [] } aes_module.store = function(){ rbbt.LS.store(this.LS_key, this.aesthetics) } aes_module.add = function(selector, aes, value){ this.aesthetics.push({selector: selector, aes: aes, value: value}) } aes_module.clear_aesthetic = function(aes){ var data_key = 'data-aes-' + aesthetic.aes $('[' + data_key + ']').attr(data_key, 'none') } aes_module.apply_aesthetic = function(aesthetic){ if (typeof aesthetic.selector == "string"){ targets = $(aesthetic.selector) }else{ var items = aesthetic.selector targets = $('.entity').filter(function(index){ var id = $(this).attr('data-entity-id') return items.indexOf(id) >= 0 }) } var data_key = 'data-aes-' + aesthetic.aes targets.attr(data_key, aesthetic.value) } aes_module.apply = function(aesthetic){ if (undefined === aesthetic) this.aesthetics.map(aes_module.apply_aesthetic) else aes_module.apply_aesthetic(aesthetic) } aes_module.load() //aes_module.add(Object.keys(fav_module.entities.types()["Gene"]), 'color', 'red') //aes_module.store() //aes_module.apply()
Version data entries
6 entries across 6 versions & 1 rubygems