Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Utworzenie implementacji akcji po stronie przeglądarki

Code Block
languagejs
var variableService = ServiceFactory.getVariableService();
 
FormActions.create('hiding-variables-action', {
    var variableService,
		variables;
 
	//@override
	init: function() {
		variableService = ServiceFactory.getVariableService();
		this.variables = this.value("variables");
	},
 
	//@override
    enable: function(){
    	this.hideVariables();
    },
    
	//@override
    disable: function(){
    	this.showVariables();
    },
    
    hideVariables: function() {
    	this.setVariablesVisibility(false);
    },
    
    showVariables: function() {
    	this.setVariablesVisibility(true);
    },
    
    setVariablesVisibility: function(visible) {
    	SuncodeFormService.suspendLayouts();
    	try {
        	Ext4.Array.each(this.variables, function(variable){
        		if(visible) {
        			variableService.show(variable.id);
        		}
        		else {
        			variableService.hide(variable.id);
        		}
        	}, this);
    	}
    	finally {
    		SuncodeFormService.resumeLayouts();
    	}
    }
});