_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q34400 | train | function(callback) {
// everything is copied in case the collection is modified during the cycle
var values = this._data_values.slice(),
uids = this._data_uids.slice(),
names = this._data_names.slice(),
i = 0,
count = this._count;
for (; i < count; i++) {
if (callback(values[i], names[i], uids[i... | javascript | {
"resource": ""
} | |
q34401 | train | function(new_indices) {
var i = 0,
result = this._createHelperStorage(),
index,
verification = {};
if (Lava.schema.DEBUG && new_indices.length != this._count) throw "reorder: new item count is less than current";
for (; i < this._count; i++) {
index = new_indices[i];
result.push(this._data_uids... | javascript | {
"resource": ""
} | |
q34402 | train | function(start_index, count) {
if (count <= 0) Lava.t("Invalid item count supplied for removeRange");
if (start_index + count >= this._count + 1) Lava.t("Index is out of range");
var removed_uids = this._data_uids.splice(start_index, count),
removed_values = this._data_values.splice(start_index, count),
r... | javascript | {
"resource": ""
} | |
q34403 | train | function() {
return {
uids: [],
values: [],
names: [],
push: function(uid, value, name) {
this.uids.push(uid);
this.values.push(value);
this.names.push(name);
},
getObject: function() {
return {
uids: this.uids,
values: this.values,
names: this.names
}
}
}
... | javascript | {
"resource": ""
} | |
q34404 | train | function(data_source) {
this.guid = Lava.guid++;
if (data_source) {
var count = 0,
i = 0,
name;
if (Array.isArray(data_source)) {
for (count = data_source.length; i < count; i++) {
this._push(this._uid++, data_source[i], null);
}
} else if (data_source.isCollection) {
this... | javascript | {
"resource": ""
} | |
q34405 | train | function(data_source) {
if (Lava.schema.DEBUG && typeof(data_source) != 'object') Lava.t("Wrong argument passed to updateFromSourceObject");
if (Array.isArray(data_source)) {
this._updateFromArray(data_source, []);
} else if (data_source.isCollection) {
this._updateFromEnumerable(data_source);
} els... | javascript | {
"resource": ""
} | |
q34406 | train | function(source_array, names) {
var i = 0,
count = source_array.length,
items_removed_argument = {
uids: this._data_uids,
values: this._data_values,
names: this._data_names
};
this._data_uids = [];
this._data_values = [];
this._data_names = [];
for (; i < count; i++) {
this._push(th... | javascript | {
"resource": ""
} | |
q34407 | train | function(source_object) {
var i = 0,
name,
uid,
result = this._createHelperStorage(),
removed = this._createHelperStorage(),
added = this._createHelperStorage();
for (; i < this._count; i++) {
name = this._data_names[i];
if (name != null && (name in source_object)) {
if (source_object[n... | javascript | {
"resource": ""
} | |
q34408 | train | function(index, value, name) {
if (index > this._count) Lava.t("Index is out of range");
var old_uid = this._data_uids[index],
old_value = this._data_values[index],
old_name = this._data_names[index],
new_uid = this._uid++;
this._data_uids[index] = new_uid;
this._data_values[index] = value;
if (na... | javascript | {
"resource": ""
} | |
q34409 | train | function(value, name) {
var result = false,
index = this._data_values.indexOf(value);
if (index == -1) {
this.push(value, name);
result = true;
}
return result;
} | javascript | {
"resource": ""
} | |
q34410 | train | function(start_index, values, names) {
if (start_index >= this._count) Lava.t("Index is out of range");
var i = 0,
count = values.length,
added_uids = [],
added_names = [];
if (names) {
if (count != names.length) Lava.t("If names array is provided, it must be equal length with values array.");
... | javascript | {
"resource": ""
} | |
q34411 | train | function() {
this._data_names = this._data_source.getNames();
this._data_values = this._data_source.getValues();
this._data_uids = this._data_source.getUIDs();
this._count = this._data_uids.length;
this._fire('collection_changed');
} | javascript | {
"resource": ""
} | |
q34412 | train | function(data_source) {
if (Lava.schema.DEBUG && !data_source.isCollection) Lava.t("Wrong argument supplied for DataView constructor");
this._data_source = data_source;
} | javascript | {
"resource": ""
} | |
q34413 | train | function(template_config, widget, parent_view, child_properties) {
this.guid = Lava.guid++;
this._parent_view = parent_view;
this._widget = widget;
this._config = template_config;
this._createChildren(this._content, template_config, [], child_properties);
this._count = this._content.length;
} | javascript | {
"resource": ""
} | |
q34414 | train | function(result, children_config, include_name_stack, properties) {
var i = 0,
count = children_config.length,
childConfig,
type;
for (; i < count; i++) {
childConfig = children_config[i];
type = typeof(childConfig);
if (type == 'object') type = childConfig.type;
if (Lava.schema.DEBUG && !(... | javascript | {
"resource": ""
} | |
q34415 | train | function(result, childConfig, include_name_stack, properties) {
var constructor = Lava.ClassManager.getConstructor(childConfig['class'], 'Lava.view'),
view = new constructor(
childConfig,
this._widget,
this._parent_view,
this, // template
properties
);
view.template_index = result.push(v... | javascript | {
"resource": ""
} | |
q34416 | train | function(result, child_config, include_name_stack, properties) {
if (include_name_stack.indexOf(child_config.name) != -1) Lava.t("Infinite include recursion");
var include = Lava.view_manager.getInclude(this._parent_view, child_config);
if (Lava.schema.DEBUG && include == null) Lava.t("Include not found: " + chi... | javascript | {
"resource": ""
} | |
q34417 | train | function(name, value) {
for (var i = 0; i < this._count; i++) {
if (this._content[i].isView) {
this._content[i].set(name, value);
}
}
} | javascript | {
"resource": ""
} | |
q34418 | train | function(properties_object) {
for (var i = 0; i < this._count; i++) {
if (this._content[i].isView) {
this._content[i].setProperties(properties_object);
}
}
} | javascript | {
"resource": ""
} | |
q34419 | train | function(i) {
var result = null;
while (i < this._count) {
if (this._content[i].isView) {
result = this._content[i];
break;
}
i++;
}
return result;
} | javascript | {
"resource": ""
} | |
q34420 | train | function(label) {
var result = [],
i = 0;
for (; i < this._count; i++) {
if (this._content[i].isView && this._content[i].label == label) {
result.push(this._content[i]);
}
}
return result;
} | javascript | {
"resource": ""
} | |
q34421 | train | function(name) {
var result = [],
i = 0;
for (; i < this._count; i++) {
if (this._content[i].isWidget && this._content[i].name == name) {
result.push(this._content[i]);
}
}
return result;
} | javascript | {
"resource": ""
} | |
q34422 | train | function() {
var default_events = Lava.schema.system.DEFAULT_EVENTS,
i = 0,
count = default_events.length;
for (; i < count; i++) {
this._event_usage_counters[default_events[i]] = 1;
this._initEvent(default_events[i]);
}
} | javascript | {
"resource": ""
} | |
q34423 | train | function(view) {
if (view.depth in this._dirty_views) {
this._dirty_views[view.depth].push(view);
} else {
this._dirty_views[view.depth] = [view];
}
} | javascript | {
"resource": ""
} | |
q34424 | train | function(dirty_views) {
var level = 0,
deepness,
views_list,
has_exceptions = false,
i,
count;
deepness = dirty_views.length; // this line must be after ScopeManager#refresh()
for (; level < deepness; level++) {
if (level in dirty_views) {
views_list = dirty_views[level];
for (i = ... | javascript | {
"resource": ""
} | |
q34425 | train | function(starting_widget, id) {
if (Lava.schema.DEBUG && !id) Lava.t();
return this._views_by_id[id];
} | javascript | {
"resource": ""
} | |
q34426 | train | function(starting_widget, guid) {
if (Lava.schema.DEBUG && !guid) Lava.t();
return this._views_by_guid[guid];
} | javascript | {
"resource": ""
} | |
q34427 | train | function(view, targets, callback, callback_arguments, global_targets_object) {
var i = 0,
count = targets.length,
target,
target_name,
widget,
template_arguments,
bubble_index = 0,
bubble_targets_copy,
bubble_targets_count;
this._nested_dispatch_count++;
for (; i < count; i++) {
tar... | javascript | {
"resource": ""
} | |
q34428 | train | function(view, event_name, event_object) {
var targets = view.getContainer().getEventTargets(event_name);
if (targets) {
this.dispatchEvent(view, event_name, event_object, targets);
}
} | javascript | {
"resource": ""
} | |
q34429 | train | function(view, event_name, event_object, targets) {
this._dispatchCallback(
view,
targets,
this._callHandleEvent,
{
event_name: event_name,
event_object: event_object
},
this._global_event_targets
);
} | javascript | {
"resource": ""
} | |
q34430 | train | function(view, target) {
var result = [];
for (var i = 0, count = target.arguments.length; i < count; i++) {
if (target.arguments[i].type == Lava.TARGET_ARGUMENT_TYPES.VALUE) {
result.push(target.arguments[i].data);
} else {
if (target.arguments[i].type != Lava.TARGET_ARGUMENT_TYPES.BIND) Lava.t... | javascript | {
"resource": ""
} | |
q34431 | train | function(starting_view, config) {
var widget = starting_view.getWidget(),
template_arguments = ('arguments' in config) ? this._evalTargetArguments(starting_view, config) : null;
if ('locator_type' in config) {
widget = this['_locateWidgetBy' + config.locator_type](widget, config.locator);
if (!widget |... | javascript | {
"resource": ""
} | |
q34432 | train | function(element) {
var id = Firestorm.Element.getProperty(element, 'id'),
result = null;
if (id) {
if (id.indexOf(Lava.ELEMENT_ID_PREFIX) == 0) {
result = this.getViewByGuid(id.substr(Lava.ELEMENT_ID_PREFIX.length));
}
}
return result;
} | javascript | {
"resource": ""
} | |
q34433 | train | function(label) {
var result = [];
for (var guid in this._views_by_guid) {
if (this._views_by_guid[guid].label == label) {
result.push(this._views_by_guid[guid]);
}
}
return result;
} | javascript | {
"resource": ""
} | |
q34434 | train | function(element) {
// note: target of some events can be the root html tag (for example, mousedown on a scroll bar)
var document_ref = window.document, // document > html > body > ...
result = [];
while (element && element != document_ref) {
result.push(element);
element = element.parentNode;
}
... | javascript | {
"resource": ""
} | |
q34435 | train | function(event_name, event_object) {
var target = event_object.target,
view,
container,
stack_changed_event_name = event_name + '_stack_changed',
stack = target ? this._buildElementStack(target) : [],
i = 0,
count = stack.length;
// Warning! You must not modify the `stack` array!
this._fire(st... | javascript | {
"resource": ""
} | |
q34436 | train | function(event_name) {
if (Lava.schema.DEBUG && ['mouseenter', 'mouseleave', 'mouseover', 'mouseout'].indexOf(event_name) != -1)
Lava.t("The following events: mouseenter, mouseleave, mouseover and mouseout are served by common alias - mouse_events");
if (this._event_usage_counters[event_name]) {
this._even... | javascript | {
"resource": ""
} | |
q34437 | train | function(event_name) {
if (event_name == 'mouse_events') {
this._events_listeners['mouseover'] =
Lava.Core.addGlobalHandler('mouseover', this.handleMouseMovement, this);
this._events_listeners['mouseout'] =
Lava.Core.addGlobalHandler('mouseout', this.handleMouseMovement, this);
} else {
this._e... | javascript | {
"resource": ""
} | |
q34438 | train | function(event_name) {
if (this._event_usage_counters[event_name] == 0) {
Lava.logError("ViewManager: trying to release an event with zero usage.");
return;
}
this._event_usage_counters[event_name]--;
if (this._event_usage_counters[event_name] == 0) {
this._shutdownEvent(event_name);
}
} | javascript | {
"resource": ""
} | |
q34439 | train | function(event_name) {
if (event_name == 'mouse_events') {
Lava.Core.removeGlobalHandler(this._events_listeners['mouseover']);
this._events_listeners['mouseover'] = null;
Lava.Core.removeGlobalHandler(this._events_listeners['mouseout']);
this._events_listeners['mouseout'] = null;
} else {
Lava.Co... | javascript | {
"resource": ""
} | |
q34440 | train | function(name) {
if (!(name in this._modules)) {
var config = Lava.schema.modules[name],
className = config.type || Lava.schema.data.DEFAULT_MODULE_CLASS,
constructor = Lava.ClassManager.getConstructor(className, 'Lava.data');
// construction is split into two phases, cause initFields() may reference... | javascript | {
"resource": ""
} | |
q34441 | train | function(schema, raw_tag, parent_title) {
var widget_config = Lava.parsers.Common.createDefaultWidgetConfig(),
tags,
name,
x = raw_tag.x;
widget_config['extends'] = parent_title;
if (raw_tag.content) {
// Lava.isVoidTag is a workaround for <x:attach_directives>
// It's highly discouraged to mak... | javascript | {
"resource": ""
} | |
q34442 | train | function(raw_blocks, widget_config) {
var i = 0,
count = raw_blocks.length,
result = [];
for (; i < count; i++) {
if (raw_blocks[i].type == 'directive') {
if (Lava.parsers.Directives.processDirective(raw_blocks[i], widget_config, true)) Lava.t("Directive inside sugar has returned a value: " + raw_bl... | javascript | {
"resource": ""
} | |
q34443 | train | function(content_schema, raw_tag, widget_config) {
var tags = Lava.parsers.Common.asBlocks(raw_tag.content),
i = 0,
count,
tag_roles_map = content_schema.tag_roles,
tag_schema,
storage_tags = [];
tags = this._applyTopDirectives(tags, widget_config);
count = tags.length;
for (; i < count; i++) ... | javascript | {
"resource": ""
} | |
q34444 | train | function(widget_config, unknown_attributes, resource_name) {
var value = {
type: 'container_stack',
value: []
},
operations_stack = value.value;
if (!widget_config.resources) {
widget_config.resources = {};
}
if (!widget_config.resources['default']) {
widget_config.resources['default']... | javascript | {
"resource": ""
} | |
q34445 | train | function(widget_config, attribute_value, descriptor, name) {
Lava.store(
widget_config,
'options',
name,
Lava.ExpressionParser.parse(attribute_value, Lava.ExpressionParser.SEPARATORS.SEMICOLON)
);
} | javascript | {
"resource": ""
} | |
q34446 | train | function() {
if (!this._mouseover_stack_changed_listener) {
Lava.view_manager.lendEvent('mouse_events');
this._mouseover_stack_changed_listener = Lava.view_manager.on('mouseover_stack_changed', this._onMouseoverStackChanged, this);
if (!this._tooltip) this._tooltip = Lava.createWidget(this.DEFAULT_TOOLTIP_W... | javascript | {
"resource": ""
} | |
q34447 | train | function() {
if (this._mouseover_stack_changed_listener) {
Lava.view_manager.releaseEvent('mouse_events');
Lava.view_manager.removeListener(this._mouseover_stack_changed_listener);
this._mouseover_stack_changed_listener = null;
if (this._mousemove_listener) {
Lava.Core.removeGlobalHandler(this._mouse... | javascript | {
"resource": ""
} | |
q34448 | train | function(view_manager, stack) {
var new_tooltip_target = null,
html;
for (var i = 0, count = stack.length; i < count; i++) {
if (Firestorm.Element.hasAttribute(stack[i], this._attribute_name)) {
new_tooltip_target = stack[i];
break;
}
}
if (new_tooltip_target != this._tooltip_target) {
... | javascript | {
"resource": ""
} | |
q34449 | train | function(event_name, event_object) {
this._tooltip.set('x', event_object.page.x); // left
this._tooltip.set('y', event_object.page.y); // top
} | javascript | {
"resource": ""
} | |
q34450 | train | function () {
if (!this._focus_acquired_listener) {
this._focus_acquired_listener = Lava.app.on('focus_acquired', this._onFocusTargetAcquired, this);
this._focus_lost_listener = Lava.app.on('focus_lost', this.clearFocusedTarget, this);
this._focus_listener = Lava.Core.addGlobalHandler('blur', this._onElemen... | javascript | {
"resource": ""
} | |
q34451 | train | function() {
if (this._focus_acquired_listener) {
Lava.app.removeListener(this._focus_acquired_listener);
Lava.app.removeListener(this._focus_lost_listener);
Lava.Core.removeGlobalHandler(this._focus_listener);
Lava.Core.removeGlobalHandler(this._blur_listener);
this._focus_acquired_listener
= thi... | javascript | {
"resource": ""
} | |
q34452 | train | function(event_name, event_object) {
if (this._focused_element != event_object.target) {
this._setTarget(null);
this._focused_element = event_object.target;
}
} | javascript | {
"resource": ""
} | |
q34453 | train | function(module, name, config, module_storage) {
this._module = module;
this._name = name;
this._config = config;
this._properties_by_guid = module_storage;
if ('is_nullable' in config) this._is_nullable = config.is_nullable;
} | javascript | {
"resource": ""
} | |
q34454 | train | function(properties, raw_properties) {
if (Lava.schema.data.VALIDATE_IMPORT_DATA && !this.isValidValue(raw_properties[this._name]))
Lava.t('Invalid value in import data (' + this._name + '): ' + raw_properties[this._name]);
return raw_properties[this._name];
} | javascript | {
"resource": ""
} | |
q34455 | train | function(record_a, record_b) {
return this._properties_by_guid[record_a.guid][this._name] < this._properties_by_guid[record_b.guid][this._name];
} | javascript | {
"resource": ""
} | |
q34456 | train | function(field, event_args) {
var local_record = event_args.collection_owner;
if (local_record.guid in this._collections_by_record_guid) {
Lava.suspendListener(this._collection_listeners_by_guid[local_record.guid].removed);
this._collections_by_record_guid[local_record.guid].removeValue(event_args.child);
... | javascript | {
"resource": ""
} | |
q34457 | train | function(field, event_args) {
var local_record = event_args.collection_owner;
if (local_record.guid in this._collections_by_record_guid) {
Lava.suspendListener(this._collection_listeners_by_guid[local_record.guid].added);
this._collections_by_record_guid[local_record.guid].includeValue(event_args.child);
... | javascript | {
"resource": ""
} | |
q34458 | train | function(record, foreign_key) {
if (foreign_key in this._collections_by_foreign_id) {
this._collections_by_foreign_id[foreign_key].push(record);
} else {
this._collections_by_foreign_id[foreign_key] = [record];
}
} | javascript | {
"resource": ""
} | |
q34459 | train | function(foreign_module_id_field, event_args) {
var referenced_record = event_args.record, // record belongs to foreign module
new_referenced_id = referenced_record.get('id'),
collection,
i = 0,
count;
if (referenced_record.guid in this._collections_by_foreign_guid) {
collection = this._collection... | javascript | {
"resource": ""
} | |
q34460 | train | function(record, properties, referenced_record_id) {
properties[this._name] = this._referenced_module.getRecordById(referenced_record_id) || null;
if (properties[this._name]) {
this._registerRecord(record, properties[this._name]);
}
} | javascript | {
"resource": ""
} | |
q34461 | train | function(local_record, referenced_record) {
if (!Firestorm.Array.exclude(this._collections_by_foreign_guid[referenced_record.guid], local_record)) Lava.t();
this._fire('removed_child', {
collection_owner: referenced_record,
child: local_record
});
} | javascript | {
"resource": ""
} | |
q34462 | train | function(local_record, referenced_record) {
var referenced_guid = referenced_record.guid;
if (referenced_guid in this._collections_by_foreign_guid) {
if (Lava.schema.DEBUG && this._collections_by_foreign_guid[referenced_guid].indexOf(local_record) != -1)
Lava.t("Duplicate record");
this._collections_by... | javascript | {
"resource": ""
} | |
q34463 | train | function(record) {
if (Lava.schema.DEBUG && !(record.guid in this._properties_by_guid)) Lava.t("isLess: record does not belong to this module");
var ref_record_a = this._properties_by_guid[record.guid][this._name];
// must return undefined, cause comparison against nulls behaves differently
return ref_record_a... | javascript | {
"resource": ""
} | |
q34464 | train | function(config) {
var field_name,
type,
constructor;
for (field_name in config.fields) {
type = config.fields[field_name].type || Lava.schema.data.DEFAULT_FIELD_TYPE;
constructor = Lava.ClassManager.getConstructor(type, 'Lava.data.field');
this._fields[field_name] = new constructor(
this,
... | javascript | {
"resource": ""
} | |
q34465 | train | function() {
var default_properties = {},
field_name;
for (field_name in this._fields) {
this._fields[field_name].onModuleFieldsCreated(default_properties);
}
this._createRecordProperties = new Function(
"return " + Lava.serializer.serialize(default_properties)
);
} | javascript | {
"resource": ""
} | |
q34466 | train | function(lava_app, config, name) {
this._app = lava_app;
this._config = config;
this._name = name;
this._createFields(config);
this._record_constructor = Lava.ClassManager.getConstructor(
config.record_class || Lava.schema.data.DEFAULT_RECORD_CLASS,
'Lava.data'
);
if ('id' in this._fields) {
... | javascript | {
"resource": ""
} | |
q34467 | train | function(raw_properties) {
var result;
if (Lava.schema.DEBUG && !raw_properties.id) Lava.t('safeLoadRecord: import data must have an id');
if (raw_properties.id in this._records_by_id) {
result = this._records_by_id[raw_properties.id];
} else {
result = this.loadRecord(raw_properties);
}
retur... | javascript | {
"resource": ""
} | |
q34468 | train | function(raw_records_array) {
var i = 0,
count = raw_records_array.length,
records = [];
for (; i < count; i++) {
records.push(this._createRecordInstance(raw_records_array[i]));
}
this._fire('records_loaded', {records: records});
return records;
} | javascript | {
"resource": ""
} | |
q34469 | train | function(module, fields, properties_ref, raw_properties) {
this.guid = Lava.guid++;
this._module = module;
this._fields = fields;
this._properties = properties_ref;
var field;
if (typeof(raw_properties) != 'undefined') {
for (field in fields) {
fields[field]['import'](this, properties_ref, raw_p... | javascript | {
"resource": ""
} | |
q34470 | train | function(config) {
if ('id' in config.fields) Lava.t("Id field in MetaStorage is not permitted");
this._config = config;
this._createFields(config);
this.initFields(); // MetaStorage is constructed directly, not via App class
var field;
if (Lava.schema.DEBUG) {
for (field in this._fields) {
if (t... | javascript | {
"resource": ""
} | |
q34471 | train | function(ext_guid, raw_properties, original_record) {
if (ext_guid in this._properties) Lava.t("MetaRecord already exists");
var properties = this._createRecordProperties(),
record = new this._record_constructor(this, this._fields, properties, raw_properties, original_record);
record.ext_guid = ext_guid;
... | javascript | {
"resource": ""
} | |
q34472 | train | function(property_name) {
if (!(property_name in this._data_bindings_by_property)) {
this._data_bindings_by_property[property_name] = new Lava.scope.DataBinding(this, property_name);
}
return this._data_bindings_by_property[property_name];
} | javascript | {
"resource": ""
} | |
q34473 | train | function(path_config) {
var widget = this._widget.locateViewByPathConfig(path_config);
if (Lava.schema.DEBUG && !widget.isWidget) Lava.t("Tried to call a modifier from non-widget view");
return /** @type {Lava.widget.Standard} */ widget;
} | javascript | {
"resource": ""
} | |
q34474 | train | function() {
var result = null;
// in production - wrap evaluation into try/catch block
if (Lava.schema.DEBUG) {
result = this._evaluator();
} else {
try {
result = this._evaluator();
} catch (e) {
Lava.logException(e);
}
}
return result;
} | javascript | {
"resource": ""
} | |
q34475 | train | function(index, arguments_array) {
return this._modifier_descriptors[index].widget.callModifier(this._modifier_descriptors[index].callback_name, arguments_array);
} | javascript | {
"resource": ""
} | |
q34476 | train | function(config, widget) {
this._widget = widget;
this._property_name = config.property_name;
this._scope = widget.getScopeByPathConfig(config.path_config);
if (config.from_widget) {
this._scope.setValue(this._widget.get(this._property_name));
} else {
this._widget.set(this._property_name, this._sc... | javascript | {
"resource": ""
} | |
q34477 | train | function() {
// avoid setting nulls to non-nullable fields.
if (this._scope.isConnected()) {
// turning off both of them to avoid infinite loop. From architect's point of view, better solution would be
// to hang up developer's browser, but if it happens in production - it may have disastrous consequences.
... | javascript | {
"resource": ""
} | |
q34478 | train | function() {
Lava.suspendListener(this._widget_property_changed_listener);
this._scope_changed_listener && Lava.suspendListener(this._scope_changed_listener);
this._scope.setValue(this._widget.get(this._property_name));
Lava.resumeListener(this._widget_property_changed_listener);
this._scope_changed_listener... | javascript | {
"resource": ""
} | |
q34479 | train | function(value_container, property_name) {
this.guid = Lava.guid++;
this._value_container = value_container;
this._property_name = property_name;
this.level = value_container.level + 1;
this._container_changed_listener = value_container.on('changed', this.onParentDataSourceChanged, this);
this._refreshValu... | javascript | {
"resource": ""
} | |
q34480 | train | function() {
var property_container = this._value_container.getValue(),
value = null,
is_connected = false;
if (property_container != null) {
// Collection implements Properties, so if _property_name is not a number - then `get` will be called
if (property_container.isCollection && /^\d+$/.test(this.... | javascript | {
"resource": ""
} | |
q34481 | train | function() {
if (this._property_changed_listener && (this._value_container.getValue() != this._property_container)) {
// currently listening to the parent's old data source
this._property_changed_listener && this._property_container.removePropertyListener(this._property_changed_listener);
this._enumerable_... | javascript | {
"resource": ""
} | |
q34482 | train | function(value) {
var property_container = this._value_container.getValue();
if (property_container) {
if (this._property_changed_listener) {
Lava.suspendListener(this._property_changed_listener);
property_container.set(this._property_name, value);
Lava.resumeListener(this._property_changed_liste... | javascript | {
"resource": ""
} | |
q34483 | train | function(argument, view, widget, config) {
var i = 0,
count,
depends,
bind;
this.guid = Lava.guid++;
this._argument = argument;
this._view = view;
this._widget = widget;
this.level = argument.level + 1;
if (config) {
if (Lava.schema.DEBUG && ['Enumerable', 'DataView'].indexOf(config['own_e... | javascript | {
"resource": ""
} | |
q34484 | train | function() {
var argument_value = this._argument.getValue();
if (argument_value) {
this._refreshDataSource(argument_value);
if (this._observable_listener == null) {
if (argument_value.isCollection) {
this._observable_listener = argument_value.on('collection_changed', this._onObservableChanged, ... | javascript | {
"resource": ""
} | |
q34485 | train | function(view, property_name, assign_config) {
this.guid = Lava.guid++;
this._view = view;
this._property_name = property_name;
if (assign_config) {
this._assign_argument = new Lava.scope.Argument(assign_config, view, view.getWidget());
this._assign_argument.on('changed', this.onAssignChanged, this);
... | javascript | {
"resource": ""
} | |
q34486 | train | function(value) {
Lava.suspendListener(this._property_changed_listener);
this._view.set(this._property_name, value);
Lava.resumeListener(this._property_changed_listener);
this._queueForRefresh();
} | javascript | {
"resource": ""
} | |
q34487 | train | function(container, name_source_container) {
if (Lava.schema.DEBUG && !name_source_container.isValueContainer) Lava.t();
if (Lava.schema.DEBUG && !name_source_container.guid) Lava.t("Name source for segments must be either PropertyBinding or DataBinding");
this._container = container;
this._property_name = na... | javascript | {
"resource": ""
} | |
q34488 | train | function(view, config, widget) {
// About IOS bugfixes:
// http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
// http://www.quirksmode.org/blog/archives/2010/10/click_event_del_1.html
var needs_shim = Firestorm.Environment.platform == "ios";
Lava.ClassManager.patch(this, "Element", "addEve... | javascript | {
"resource": ""
} | |
q34489 | train | function(event_name, target) {
if (this._is_inDOM && event_name == 'click' && !(event_name in this._events)) {
this.getDOMElement().onclick = Lava.noop;
}
this.addEventTarget_Normal(event_name, target)
} | javascript | {
"resource": ""
} | |
q34490 | train | function(event_name, target) {
if (!(event_name in this._events)) {
this._events[event_name] = [target];
} else {
this._events[event_name].push(target);
}
} | javascript | {
"resource": ""
} | |
q34491 | train | function(name, value) {
if (Lava.schema.DEBUG && name == 'id') Lava.t();
if (Lava.schema.DEBUG && (name in this._property_bindings)) Lava.t("Property is bound to an argument and cannot be set directly: " + name);
this._static_properties[name] = value;
} | javascript | {
"resource": ""
} | |
q34492 | train | function(class_name, cancel_sync) {
if (Lava.schema.DEBUG && (!class_name || class_name.indexOf(' ') != -1)) Lava.t("addClass: expected one class name, got: " + class_name);
if (Firestorm.Array.include(this._static_classes, class_name)) {
if (this._is_inDOM && !cancel_sync) Firestorm.Element.addClass(this.get... | javascript | {
"resource": ""
} | |
q34493 | train | function(class_name, cancel_sync) {
if (Firestorm.Array.exclude(this._static_classes, class_name)) {
if (this._is_inDOM && !cancel_sync) Firestorm.Element.removeClass(this.getDOMElement(), class_name);
}
} | javascript | {
"resource": ""
} | |
q34494 | train | function(class_names, cancel_sync) {
if (Lava.schema.DEBUG && typeof(class_names) == 'string') Lava.t();
for (var i = 0, count = class_names.length; i < count; i++) {
this.addClass(class_names[i], cancel_sync);
}
} | javascript | {
"resource": ""
} | |
q34495 | train | function(name, value, cancel_sync) {
if (value == null) {
this.removeStyle(name, cancel_sync);
} else {
this._static_styles[name] = value;
if (this._is_inDOM && !cancel_sync) Firestorm.Element.setStyle(this.getDOMElement(), name, value);
}
} | javascript | {
"resource": ""
} | |
q34496 | train | function(name, cancel_sync) {
if (name in this._static_styles) {
delete this._static_styles[name];
if (this._is_inDOM && !cancel_sync) Firestorm.Element.setStyle(this.getDOMElement(), name, null);
}
} | javascript | {
"resource": ""
} | |
q34497 | train | function(configs, view, fn) {
var result = {},
argument;
for (var name in configs) {
argument = new Lava.scope.Argument(configs[name], view, this._widget);
result[name] = argument;
argument.on('changed', fn, this, {name: name})
}
return result;
} | javascript | {
"resource": ""
} | |
q34498 | train | function(argument, event_args, listener_args) {
if (this._is_inDOM) {
// note: escape will be handled by framework
var value = argument.getValue();
if (value != null && value !== false) {
if (value === true) {
value = listener_args.name;
}
Firestorm.Element.setProperty(this.getDOMElemen... | javascript | {
"resource": ""
} | |
q34499 | train | function(argument, event_args, listener_args) {
var value = this._style_bindings[listener_args.name].getValue() || '';
if (this._is_inDOM) Firestorm.Element.setStyle(this.getDOMElement(), listener_args.name, value.toString().trim());
} | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.