Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var renderedElement = crel('input'),
updateEventNames = (this.updateEventName || "change").split(' ');
this._removeHandlers.push(this.gaffa.events.on(this.updateEventName || "change", renderedElement, setValue));
this.renderedElement = renderedElement;
};
Textbox.prototype.value = new Gaffa.Property(updateValue);
Textbox.prototype.subType = new Gaffa.Property(updateSubType);
Textbox.prototype.placeholder = new Gaffa.Property(updatePlaceholder);
Textbox.prototype.disabled = new Gaffa.Property(updateDisabled);
Textbox.prototype.required = new Gaffa.Property(updateRequired);
module.exports = Textbox;
Textbox.prototype.render = function(){
var renderedElement = crel('input'),
updateEventNames = (this.updateEventName || "change").split(' ');
this._removeHandlers.push(this.gaffa.events.on(this.updateEventName || "change", renderedElement, setValue));
this.renderedElement = renderedElement;
};
Textbox.prototype.value = new Gaffa.Property(updateValue);
Textbox.prototype.subType = new Gaffa.Property(updateSubType);
Textbox.prototype.placeholder = new Gaffa.Property(updatePlaceholder);
Textbox.prototype.disabled = new Gaffa.Property(updateDisabled);
Textbox.prototype.required = new Gaffa.Property(updateRequired);
module.exports = Textbox;
var Gaffa = require('gaffa'),
actionType = "switch";
function Switch(){}
Switch = Gaffa.createSpec(Switch, Gaffa.Action);
Switch.prototype.type = actionType;
Switch.prototype['switch'] = new Gaffa.Property();
Switch.prototype.trigger = function(parent, scope, event) {
if(this['switch'].value != null){
this.triggerActions(this['switch'].value, scope, event);
}
};
module.exports = Switch;
this._removeHandlers.push(this.gaffa.events.on(this.updateEventName || "change", renderedElement, setValue));
this.renderedElement = renderedElement;
};
Textbox.prototype.value = new Gaffa.Property(updateValue);
Textbox.prototype.subType = new Gaffa.Property(updateSubType);
Textbox.prototype.placeholder = new Gaffa.Property(updatePlaceholder);
Textbox.prototype.disabled = new Gaffa.Property(updateDisabled);
Textbox.prototype.required = new Gaffa.Property(updateRequired);
module.exports = Textbox;
option.setAttribute('type', 'radio');
option.setAttribute('name', groupName);
option.setAttribute('value', currentValue);
option.setAttribute('id', groupName + currentValue);
label.innerHTML = gaffa.utils.getProp(value, i + gaffa.pathSeparator + property.textPath);
label.setAttribute('for', groupName + currentValue);
element.append($(container).append(option, label));
}
}
}
}
Radio.prototype.groupName = new Gaffa.Property(updateOptions);
Radio.prototype.options = new Gaffa.Property(updateOptions);
Radio.prototype.value = new Gaffa.Property(function (viewModel, value) {
var options = $(this.renderedElement).find('input');
options.each(function(){
var option = $(this);
if(value === option.attr('value')){
option.attr("checked", "checked");
}
});
});
module.exports = Radio;
var Gaffa = require('gaffa'),
behaviourType = 'pageLoad';
function PageLoadBehaviour(){}
PageLoadBehaviour = Gaffa.createSpec(PageLoadBehaviour, Gaffa.Behaviour);
PageLoadBehaviour.prototype.type = behaviourType;
PageLoadBehaviour.prototype.bind = function(){
this.gaffa.actions.trigger(this.actions.load, this);
};
module.exports = PageLoadBehaviour;
var Gaffa = require('gaffa'),
actionType = "fromJson";
function FromJson(){}
FromJson = Gaffa.createSpec(FromJson, Gaffa.Action);
FromJson.prototype.type = actionType;
FromJson.prototype.trigger = function(){
this.target.set(JSON.parse(this.source.value), this);
};
FromJson.prototype.target = new Gaffa.Property();
FromJson.prototype.source = new Gaffa.Property();
module.exports = FromJson;
psudoParent.parent = this;
psudoParent.sourcePath = keys ? keys[i] : '' + i;
var actions = JSON.parse(JSON.stringify(this.actions['forEach']));
psudoParent.actions.all = actions;
psudoParent = this.gaffa.initialiseViewItem(psudoParent, psudoParent.gaffa, psudoParent.actions.constructors);
scope.item = items[i];
psudoParent.triggerActions('all', scope, event);
}
};
function EachPsudoParent(){}
EachPsudoParent = Gaffa.createSpec(EachPsudoParent, Gaffa.Action);
EachPsudoParent.prototype.type = 'eachPsudoParent';
module.exports = ForEach;
var Gaffa = require('gaffa'),
crel = require('crel'),
viewType = "switchContainer",
cachedElement;
function SwitchContainer(){}
SwitchContainer = Gaffa.createSpec(SwitchContainer, Gaffa.ContainerView);
SwitchContainer.prototype.type = viewType;
SwitchContainer.prototype.render = function(){
var renderedElement = crel(this.tagName || 'div');
this.views.content.element = renderedElement;
this.renderedElement = renderedElement;
};
function createNewView(property, template, templateKey){
if(!property.templateCache){
property.templateCache= {};
}
var view = JSON.parse(
var Gaffa = require('gaffa'),
behaviourType = 'modelChange';
function executeBehaviour(behaviour, value){
behaviour.gaffa.actions.trigger(behaviour.actions.change, behaviour);
}
function ModelChangeBehaviour(){}
ModelChangeBehaviour = Gaffa.createSpec(ModelChangeBehaviour, Gaffa.Behaviour);
ModelChangeBehaviour.prototype.type = behaviourType;
ModelChangeBehaviour.prototype.condition = new Gaffa.Property({value: true});
ModelChangeBehaviour.prototype.watch = new Gaffa.Property({
update: function(behaviour, value){
var gaffa = behaviour.gaffa;
if(!behaviour.condition.value){
return;
}
var throttleTime = behaviour.throttle;
if(!isNaN(throttleTime)){
var now = new Date();
if(!behaviour.lastTrigger || now - behaviour.lastTrigger > throttleTime){
behaviour.lastTrigger = now;
executeBehaviour(behaviour, value);