Skip to content

Commit 7820569

Browse files
small tweaks to program objects
1 parent ef2d1cb commit 7820569

File tree

2 files changed

+102
-23
lines changed

2 files changed

+102
-23
lines changed

lib/framePattern.js

Lines changed: 99 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ FramePattern.prototype.getRendererType = function(frame){
302302
}
303303

304304
function FrameRule(){
305-
this.rule = { pattern: {}};
305+
this.rule = { pattern: {} };
306306
return this;
307307
}
308308

@@ -311,26 +311,6 @@ FrameRule.prototype.scope = function(scope){
311311
return this;
312312
}
313313

314-
FrameRule.prototype.renderer = function(rend){
315-
this.rule.renderer = rend;
316-
return this;
317-
}
318-
319-
FrameRule.prototype.render = function(func){
320-
this.rule.render = func;
321-
return this;
322-
}
323-
324-
FrameRule.prototype.args = function(json){
325-
this.rule.args = json;
326-
return this;
327-
}
328-
329-
FrameRule.prototype.compare = function(func){
330-
this.rule.compare = func;
331-
return this;
332-
}
333-
334314
FrameRule.prototype.frame_type = function(...frametype){
335315
this.rule.pattern.frametype = frame_type;
336316
return this;
@@ -404,5 +384,103 @@ FrameRule.prototype.status = function(...status){
404384
return this;
405385
}
406386

387+
FrameRule.prototype.renderer = function(rend){
388+
if(!rend) return this.rule.renderer;
389+
this.rule.renderer = rend;
390+
return this;
391+
}
392+
393+
FrameRule.prototype.render = function(func){
394+
if(func){
395+
this.rule.render = func;
396+
return this;
397+
}
398+
return func;
399+
}
400+
401+
FrameRule.prototype.args = function(json){
402+
if(!json) return this.rule.args;
403+
this.rule.args = json;
404+
return this;
405+
}
406+
407+
FrameRule.prototype.compare = function(func){
408+
if(!func) return this.rule.compare;
409+
this.rule.compare = func;
410+
return this;
411+
}
412+
413+
FrameRule.prototype.mode = function(m){
414+
if(!m) return this.rule.mode;
415+
this.rule.mode = m;
416+
return this;
417+
}
418+
419+
FrameRule.prototype.collapse = function(m){
420+
if(!m) return this.rule.collapse;
421+
this.rule.collapse = m;
422+
return this;
423+
}
424+
425+
426+
FrameRule.prototype.hidden = function(m){
427+
if(!m) return this.rule.hidden;
428+
this.rule.hidden = m;
429+
return this;
430+
}
431+
432+
FrameRule.prototype.view = function(m){
433+
if(!m) return this.rule.view;
434+
this.rule.view = m;
435+
return this;
436+
}
437+
438+
FrameRule.prototype.show_disabled_buttons = function(m){
439+
if(!m) return this.rule.show_disabled_buttons;
440+
this.rule.hide_disabled_buttons = m;
441+
return this;
442+
}
443+
444+
FrameRule.prototype.features = function(m){
445+
if(!m) return this.rule.features;
446+
this.rule.features = m;
447+
return this;
448+
}
449+
450+
FrameRule.prototype.header_features = function(m){
451+
if(!m) return this.rule.header_features;
452+
this.rule.header_features = m;
453+
return this;
454+
}
455+
456+
FrameRule.prototype.header = function(m){
457+
if(!m) return this.rule.header;
458+
this.rule.header = m;
459+
return this;
460+
}
461+
462+
FrameRule.prototype.feature_renderers = function(m){
463+
if(!m) return this.rule.feature_renderers;
464+
this.rule.feature_renderers = m;
465+
return this;
466+
}
467+
468+
FrameRule.prototype.show_empty = function(m){
469+
if(!m) return this.rule.show_empty;
470+
this.rule.show_empty = m;
471+
return this;
472+
}
473+
474+
FrameRule.prototype.dataviewer = function(m){
475+
if(!m) return this.rule.dataviewer;
476+
this.rule.dataviewer = m;
477+
return this;
478+
}
479+
480+
FrameRule.prototype.dataviewer_options = function(m){
481+
if(!m) return this.rule.dataviewer_options;
482+
this.rule.dataviewer_options = m;
483+
return this;
484+
}
407485

408486
module.exports = {FramePatternMatcher, FramePattern, FrameRule } ;

lib/objectFrame.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ function PropertyFrame(property, cframe, parent){
445445

446446
PropertyFrame.prototype.addFrame = function (frame) {
447447
if(this.cframe.isData()){
448-
var df = new DataFrame(frame, this);
448+
var df = new DataFrame(frame, this, this.values.length);
449449
this.values.push(df);
450450
}
451451
else {
@@ -602,11 +602,12 @@ PropertyFrame.prototype.sortValues = function(){
602602
return this.values;
603603
}
604604

605-
function DataFrame(frame, parent) {
605+
function DataFrame(frame, parent, index) {
606606
this.err = false;
607607
this.parent = parent;
608608
// the id of the object that owns this dataframe
609609
this.subjid = (parent ? parent.subjid : false);
610+
this.index = index;
610611
if (frame) {
611612
this.load(frame);
612613
}

0 commit comments

Comments
 (0)