1function vd_component(tag) { 2 tag.mixin({store:d_visual_designer}); 3 4 tag.state = { 5 top: !_.isNull(tag.parent) ? tag.parent.getState().top : tag, 6 level: !_.isNull(tag.parent) ? tag.parent.getState().level: null, 7 opts: JSON.parse(JSON.stringify(tag.opts)) 8 }; 9 10 tag.state_updated = false; 11 tag.state_always_update = !_.isUndefined(arguments[1])? !arguments[1] : false; 12 13 tag.shouldUpdate = function(data, nextOpts) { 14 return (!_.isEqual(nextOpts, tag.getState('opts')) || tag.state_updated || this.state_always_update); 15 }; 16 17 this.controlDisable = function() { 18 this.state_always_update = true; 19 }; 20 21 tag.on('update', function(){ 22 tag.setState('opts', JSON.parse(JSON.stringify(tag.opts))); 23 }); 24 25 tag.on('updated', function(){ 26 tag.state_updated = false; 27 }); 28 29 tag.initState = function(data) { 30 tag.setState(data); 31 tag.state_updated = false; 32 }; 33 34 tag.getState = function() { 35 if(!_.isUndefined(arguments[0])){ 36 return !_.isUndefined(tag.state[arguments[0]]) ? tag.state[arguments[0]] : null; 37 } else { 38 return tag.state; 39 } 40 }; 41 42 tag.setState = function(){ 43 if(_.isObject(arguments[0])){ 44 for(var key in arguments[0]){ 45 tag.state[key] = arguments[0][key]; 46 } 47 } else { 48 tag.state[arguments[0]] = arguments[1]; 49 } 50 51 tag.state_updated = true; 52 }; 53}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.