// Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), function( i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } );
jQuery.fn.extend( { prop: function( name, value ) { return access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { return this.each( function() { delete this[ jQuery.propFix[ name ] || name ]; } ); } } );
function moveDom(id, data, num) { $('#' + id).find(".div").each(function (index, item) { $(item).css({"backgroundColor": "#dcdcdc"}) $(item).css({ 'left': diff * (data.index + index) + 'px' }) if(data.matchArr.length && index <= data.matchArr.length - 1) { $(item).css({"backgroundColor": "red"}) } }).parent().siblings('.num').find('span').html(num) }
const listIndentation = (editor: Editor, lists: Element[], indentation: Indentation) => { const entrySets: EntrySet[] = parseLists(lists, getItemSelection(editor)); Arr.each(entrySets, (entrySet) => { indentSelectedEntries(entrySet.entries, indentation); const composedLists = composeEntries(editor, entrySet.entries); Arr.each(composedLists, (composedList) => { fireListEvent(editor, indentation === Indentation.Indent ? ListAction.IndentList : ListAction.OutdentList, composedList.dom()); }); InsertAll.before(entrySet.sourceList, composedLists); Remove.remove(entrySet.sourceList); }); }
db.each('', null, row => { const v = row.value; }) .then((data: any[]) => { });
_.mixin({ deepOmit: function(obj, iteratee, context) { var r = _.omit(obj, iteratee, context); _.each(r, function(val, key) { if (typeof(val) === 'object') r[key] = _.deepOmit(val, iteratee, context); }); return r; } });
function keepNodesOnTop () { $('.nodeStrokeClass').each(function (index) { var gnode = this.parentNode gnode.parentNode.appendChild(gnode) }) d3.selectAll('circle').attr('r', function (d) { return d.weight }) }
_.each(removePaths, (p) => { const idx = context.module.paths.indexOf(p); if(p !== -1) { context.module.paths.splice(p, 1); } });
_.each(users, (user, i) => { user.id = i + 1; delete user.avatar; delete user.gravatar; delete user.dob; delete user.website; delete user.address; delete user.ip; });
new RestQuery( this.config, master(this.config), '_Role', restWhere, {} ).each(result => results.push(result))
const normalizeLists = function (dom, element) { Tools.each(Tools.grep(dom.select('ol,ul', element)), function (ul) { normalizeList(dom, ul); }); }
$.each(apiByGroupAndName[group][name], function(index, entry) { if (entry.version === version) sourceEntry = entry; if (entry.version === selectedVersion) compareEntry = entry; });
const setAttribs = function (elm, attrs) { Tools.each(attrs, function (value, key) { elm.setAttribute(key, value); }); }
/** * Shorthand for batch-register operations. * Internally calls `register` for each condition. * @param conditions */ registerMany(conditions) { _.each(conditions, condition => this.register(condition)); return this; }
/** * Shorthand for batch-register operations. * Internally calls `register` for each condition. * @param conditions */ registerMany(conditions) { _.each(conditions, condition => this.register(condition)); return this; }