_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
27
233k
language
stringclasses
1 value
meta_information
dict
q43500
train
function(ops, callback) { if(!callback) callback = function() { }; //name of the script to run for supervisord if(!ops.name) ops.name = 'undefined'; var supervisordName = this._name(ops.name); //script exists? split it apart if(ops.script) { ops.di...
javascript
{ "resource": "" }
q43501
train
function(ops, callback) { var search = typeof ops == 'string' ? { name: ops } : ops, query = this._query(search), self = this; //stop the app in case... self.stop(search.name, function(err, result) {
javascript
{ "resource": "" }
q43502
ForwardMochaReporter
train
function ForwardMochaReporter(mochaRunner, options) { Base.call(this, mochaRunner, options); forwardEvent(mochaRunner, runner, 'start'); forwardEvent(mochaRunner, runner, 'suite'); forwardEvent(mochaRunner, runner, 'suite end'); forwardEvent(mochaRunner, runner, 'pending'); forwardEvent(mochaRun...
javascript
{ "resource": "" }
q43503
logtime
train
function logtime() { var d = new Date() , space = ' ' , delimiter = ':' , str = d.toString() , month = str.split(' ')[1]; return d.getDate() + space + month + space
javascript
{ "resource": "" }
q43504
Console
train
function Console (lc2, position, debug) { this.lc2 = lc2 this.position = position this.debug = debug || false this.name = 'Console'
javascript
{ "resource": "" }
q43505
train
function() { FS.readFile(path, options.encoding, function(err, text) { if (err) {
javascript
{ "resource": "" }
q43506
pickup
train
function pickup (/*len, dict || dict */) { var str = '', pos; var len, dict; if (arguments.length === 1) { dict = arguments[0]; len = 1; } else if (arguments.length === 2) { len = arguments[0]; dict = arguments[1]; } else
javascript
{ "resource": "" }
q43507
train
function(x, reload){ // Get the numeric ID for the module to load. var id = modules[name][1][x]; // If there's a matching module in the testability cache, return
javascript
{ "resource": "" }
q43508
groupMembershipMiddleware
train
function groupMembershipMiddleware(groups) { if (typeof groups === 'string') { groups = [groups]; } return function hasGroupMembership(req, res, next) { if (req.locals.user) { const userGroups = req.locals.user.groups || []; for (let group of groups) { if (userGroups.indexOf(group) !== -1) { ...
javascript
{ "resource": "" }
q43509
isLoggedInMiddleware
train
function isLoggedInMiddleware() { return function isLoggedIn(req, res, next) { const AclUser = mongoose.model("TransomAclUser"); if ((req.headers && req.headers.authorization) || (req.body && req.body.access_token) || (req.query && req.query.access_token)) { // Verify the authorization token or fail. p...
javascript
{ "resource": "" }
q43510
prepareContext
train
function prepareContext(screenstoryRunner, options, context, file, mochaRunner) { debug('prepare context for %s', file); var wdOptions = { desiredCapabilities: options.wdCapabilities, host: options.wdHost, port: options.wdPort, user: options.wdUser...
javascript
{ "resource": "" }
q43511
train
function(req, requiredParams) { // Find all missing parameters var missingParams = []; _.forEach(requiredParams, function(requiredParam) { if ( Mixins.isNullOrUndefined(req.params && req.params[requiredParam]) && Mixins.isNullOrUndefined(req.query && req.query[requiredParam...
javascript
{ "resource": "" }
q43512
train
function(missingParams) { var errParts = []; missingParams = _.map(missingParams, function(missingParam) { return '`' + missingParam + '`'; }); errParts.push("Missing");
javascript
{ "resource": "" }
q43513
train
function() { // Used for de-duping var paths = {}; // Each controller has a `routes` object // Connect all routes defined in controllers _.forEach(router.controllers, function(controller) { _.forEach(controller.routes, function(route, method) { _.forEach(route, function(...
javascript
{ "resource": "" }
q43514
toRooms
train
function toRooms(data) { var i, rooms; rooms = []; for (i = 0; i < data.rooms.length; i++) {
javascript
{ "resource": "" }
q43515
parseActiveChildren
train
function parseActiveChildren(values, active) { let activeChild = false; const activeValues = values.map(function (val) { const childrenTraversed = (val.children && parseActiveChildren(val.children, active)); const isActive = val.value === active || Boolean(childrenTraversed
javascript
{ "resource": "" }
q43516
queueLauncherKey
train
function queueLauncherKey(asKey, subprocess) { return function processTarget(targets) { return Object .keys(targets) .map(function (targetName) { return subprocess(targets[targetName]) .map(function (launcher) { launcher[asKey] = targetName;
javascript
{ "resource": "" }
q43517
generateSauceLabsKarmaCustomLaunchers
train
function generateSauceLabsKarmaCustomLaunchers(config) { return processPlatform(config) .reduce(function (memo, launcher) { var launcherName = [ SAUCELABS_PREFIX, shorty(launcher.platform), shorty(launcher.browserName), launcher.version ].join('_'); memo[launcherN...
javascript
{ "resource": "" }
q43518
separateMultiClassArffData
train
function separateMultiClassArffData(arffData, outputAttributes) { if (!Array.isArray(outputAttributes) || outputAttributes.length === 0) { outputAttributes = [arffData.attributes[arffData.attributes.length - 1]]; } outputAttributes.forEach((attribute) => { if (arffData.types[attribute].hasOwnProperty...
javascript
{ "resource": "" }
q43519
loadArff
train
function loadArff(fileName, callback) { ARFF.load(fileName, (error, data) => { if (error) { throw new Error(filename + error);
javascript
{ "resource": "" }
q43520
random
train
function random() { var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var range = arguments.length >
javascript
{ "resource": "" }
q43521
train
function(obj, name, callback){ if (!obj) return Belt.noop; var s = _.pick(obj, B._api_objects[name + 's']); var stream = B._gateway[name].search(function(search){ _.each(s, function(v, k){ if (_.isObject(v)) return search[k].call(search)[v.op](v.val, v.val2);
javascript
{ "resource": "" }
q43522
xcatalog
train
function xcatalog(id) { const definition = definitions.get(id); if (!definition) { throw new TypeError("No definition for: " + id); } if (!definition.fac) {
javascript
{ "resource": "" }
q43523
initBrowser
train
function initBrowser() { if (window.chrome) { Object.assign(module.exports, chromeConstants); } else {
javascript
{ "resource": "" }
q43524
generateCodeDocs
train
function generateCodeDocs() { config.codeFiles.forEach(function (jsFile) { var jf = [jsFile]; documentation(jf, {}, function (err, result) {
javascript
{ "resource": "" }
q43525
Stylesheet
train
function Stylesheet() { var styleElement = document.createElement('style'), head = document.getElementsByTagName('head')[0]; head.appendChild(styleElement); // Safari does not see the new stylesheet unless you append something. // However! IE will blow chunks, so
javascript
{ "resource": "" }
q43526
train
function (validations) { if (!validations) { return this; } if (!this.validations) { this.validations = []; } var that = this; _.isArray(validations) || (validations = [ validations ]);
javascript
{ "resource": "" }
q43527
train
function (flagOrBuilder) { if (_.isFunction(flagOrBuilder)) { this.object(flagOrBuilder);
javascript
{ "resource": "" }
q43528
train
function (schema, process) { var that = this; if (!(schema instanceof Schema)) { throw new Error('first argument must be instance of Schema'); } if (process) { var r = process.call(this, schema); if (r != null && !r) { return this; } } _.each(schema.fields, function (fieldSchema, fieldNa...
javascript
{ "resource": "" }
q43529
train
function (name, validation) { if (name == null && validation == null) { delete this.isRequired;
javascript
{ "resource": "" }
q43530
train
function (name, validation) { if (name == null && validation == null) {
javascript
{ "resource": "" }
q43531
preciseRound
train
function preciseRound(num) { var decimals = options.round ?
javascript
{ "resource": "" }
q43532
remToPx
train
function remToPx(remArray) { var pxArray = remArray.map(function(v) { if (regexCalc.test(v)) { return v; } else if (regexRem.test(v)) { // this one is needed to split properties like '2rem/1.5' var restValue = ''; if (/\//.test(v)) { ...
javascript
{ "resource": "" }
q43533
createBaseSize
train
function createBaseSize(value) { if (/px/.test(value)) { return value.replace(/px/, ''); } if (/em|rem/.test(value))
javascript
{ "resource": "" }
q43534
findRoot
train
function findRoot(r) { r.selectors.forEach(function(s) { // look for 'html' selectors if (regexHtml.test(s)) { r.declarations.forEach(function(d) { var foundSize = false; // look for the 'font' property if (d.property === 'font' && reg...
javascript
{ "resource": "" }
q43535
findRems
train
function findRems(rule) { for (var i = 0; i < rule.declarations.length; i++) { var declaration = rule.declarations[i]; // grab values that contain 'rem' if (declaration.type === 'declaration' && isSupported(declaration) && regexRem.test(declaration.value)) { var pxVa...
javascript
{ "resource": "" }
q43536
propagateError
train
function propagateError(error) { flow.pendingRejections_ += 1; return
javascript
{ "resource": "" }
q43537
then
train
function then(opt_callback, opt_errback) { // Avoid unnecessary allocations if we weren't given any callback functions. if (!opt_callback && !opt_errback) { return promise; } // The moment a listener is registered, we consider this deferred to be // handled; the callback must handle any rejec...
javascript
{ "resource": "" }
q43538
train
function() { var highestTag = '0.0.0'; var tags = exec('git tag'); if (tags.code !== 0) return highestTag; tags = tags.output.split('\n'); tags.forEach(function(tag) { tag = semver.valid(tag);
javascript
{ "resource": "" }
q43539
makeChainedWaterfallCallback
train
function makeChainedWaterfallCallback(i, fns, cb) { return function() { var args = Array.prototype.slice.call(arguments); if (args[0]) { //ie. we had an error return cb(args[0]); } if (fns[i + 1]) { //remove error ar...
javascript
{ "resource": "" }
q43540
makeChainedCallback
train
function makeChainedCallback(i, fns, results, cb) { return function(err, result) { if (err) { return cb(err); } results[i] = result; if (fns[i + 1]) {
javascript
{ "resource": "" }
q43541
makeCountNCallback
train
function makeCountNCallback(n, cb) { var count = 0, results = [], error; return function(index, err, result) { results[index] = result; if (!error && err) {
javascript
{ "resource": "" }
q43542
logentriesRawStream
train
function logentriesRawStream(pathname, query={}) { query = Object.assign({}, query); // If query format is not defined, we set it by default to JSON. if (!query.format) { query.format = 'json'; } // Text format is default in Logentries, in this case we remove the parameter. if (query.f...
javascript
{ "resource": "" }
q43543
logentriesJsonStream
train
function logentriesJsonStream(pathname, query={}) { query = Object.assign({}, query); // Force query format to JSON. query.format = 'json'; // Parse each array entry from
javascript
{ "resource": "" }
q43544
logentriesConnect
train
function logentriesConnect(options={}) { // Define path to access specific account, log set and log. let pathname = '/' + encodeURIComponent(options.account) + '/hosts/' + encodeURIComponent(options.logset) + '/' + encodeURIComponent(options.log) + '/';
javascript
{ "resource": "" }
q43545
CacheModule
train
function CacheModule(settings, cacheName, serviceHandler, serviceCallName) { if (serviceCallName == null) { serviceCallName = "call"; } settings.init("cacheModules", { expiration: { "default": 1800000 } }); this.settings = settings; ...
javascript
{ "resource": "" }
q43546
addUser
train
function addUser(db, username, password, options, callback) { const Db = require('../db'); // Did the user destroy the topology if (db.serverConfig && db.serverConfig.isDestroyed()) return callback(new MongoError('topology was destroyed')); // Attempt to execute auth command executeAuthCreateUserCommand(...
javascript
{ "resource": "" }
q43547
morphic
train
function morphic(options) { var optionsIn = options || {}; var Matcher = optionsIn.matcherCore || defaultMatcher var matcher = new Matcher(optionsIn); var generateMatchers = optionsIn.generateMatchers || defaultGenerateMatchers; var generateNamedFieldExtractors = optionsIn.generateNamedFieldExtractors || defa...
javascript
{ "resource": "" }
q43548
LoopChain
train
function LoopChain(cond, fns) { if (fns instanceof Array) Chain.apply(this, fns); else Chain.apply(this, slice.call(arguments, 1));
javascript
{ "resource": "" }
q43549
Branch
train
function Branch(cond, t, f) { this.cond = this.wrap(cond); this.if_true = this.wrap(t); this.if_false
javascript
{ "resource": "" }
q43550
__chain_inner
train
function __chain_inner(result) { var args = slice.call(arguments, 1); nextTick(function() { try { if (result) { var params = that.handle_args(env, that.if_true, args); params.unshift(env, after); env._fm.$push_call(helpers.fname(that.if_true, that.if_true.fn.name)); that.if_true.fn.apply(...
javascript
{ "resource": "" }
q43551
replaceWith
train
function replaceWith(input, regex, content) { // Sanity check verifyParameterIsDefined(input, 'input', 'replaceWith'); verifyParameterIsDefined(regex, 'regex', 'replaceWith');
javascript
{ "resource": "" }
q43552
afterElementOpen
train
function afterElementOpen(input, element, content) { // Sanity check verifyParameterIsDefined(input, 'input', 'afterElementOpen'); verifyParameterIsDefined(element, 'element', 'afterElementOpen');
javascript
{ "resource": "" }
q43553
beforeElementClose
train
function beforeElementClose(input, element, content) { // Sanity check verifyParameterIsDefined(input, 'input', beforeElementClose.name); verifyParameterIsDefined(element, 'element', beforeElementClose.name);
javascript
{ "resource": "" }
q43554
insertComment
train
function insertComment(input, element, comment) { // Sanity check verifyParameterIsDefined(input, 'input', insertComment.name); verifyParameterIsDefined(element, 'element', insertComment.name);
javascript
{ "resource": "" }
q43555
insertAttribute
train
function insertAttribute(input, element, attributeName, attributeValue) { // Sanity check verifyParameterIsDefined(input, 'input', insertAttribute.name); verifyParameterIsDefined(element, 'element', insertAttribute.name);
javascript
{ "resource": "" }
q43556
train
function(keyname) { const _ = Struct.PriProp(keyname); if (_.__proto__) { _.__proto__ = Struct.prototype; } else { Object.keys(Struct.prototype).forEach(function(p) { Object.defineProperty(_, p, { value : Struct.prototype[p], writable : false }); }, this); } var cl...
javascript
{ "resource": "" }
q43557
Model
train
function Model(collectionName, attributes, values) { this.collectionName = collectionName; this.idAttribute = Model.getId(attributes); this.attributes = attributeValidator.validate(attributes); this.values = { }; this.virtuals = { }; // initially add the null value from all attributes for (...
javascript
{ "resource": "" }
q43558
drop
train
function drop (n, array) { return (n <
javascript
{ "resource": "" }
q43559
_getRequiredAdCountForAdUnit
train
function _getRequiredAdCountForAdUnit(adUnit) { var adContainers = page.getAdContainers(adUnit); if (!adContainers.length) { return 0; }
javascript
{ "resource": "" }
q43560
_buildImageFields
train
function _buildImageFields(data){ var newUnits = []; for (var i = 0, len = data.length; i < len; i++){ adUnit = data[i]; // todo: create adUnit object to encapsulate this logic if ('images' in adUnit){ if ('banner' in adUnit.images){ adUnit.campaign_banner_url = adUnit.images.banner.ur...
javascript
{ "resource": "" }
q43561
requestAds
train
function requestAds(adUnit, callback) { var limit = _getRequiredAdCountForAdUnit(adUnit); var token = page.getToken(); var imageType = adUnit.imageType; if (typeof imageType == 'undefined'){ imageType = "hq_icon"; } var requestQuery = { "output": "json", "placement_key": ad...
javascript
{ "resource": "" }
q43562
clean
train
function clean(method) { for (let m of methods) { if (new RegExp(m, 'i').test(method)) { return m; } }
javascript
{ "resource": "" }
q43563
middleware
train
function middleware(req, res, next)
javascript
{ "resource": "" }
q43564
onEachExcludedRoute
train
function onEachExcludedRoute(app, route) { const normalized = normalize(route); debug(`Excluding ${(normalized.method || 'all').toUpperCase()} ${normalized.path} from CSRF check...`); const router = app.route(normalized.path);
javascript
{ "resource": "" }
q43565
block
train
function block(w, h, d){ return function(cons, nil){ for (var z=-d; z<=d; ++z) for (var y=-h; y<=h;
javascript
{ "resource": "" }
q43566
sphereVoxels
train
function sphereVoxels(cx, cy, cz, r, col){ return function(cons, nil){ sphere(cx, cy, cz, r)(function(x, y, z, res){
javascript
{ "resource": "" }
q43567
dumpFiles
train
function dumpFiles(title, fn) { var matches = fn(); if (matches.length) { log.info(""); log.info((title + ":")['green']); for (var i = 0; i < matches.length; i++) { if (matches[i].src === matches[i].dst) { ...
javascript
{ "resource": "" }
q43568
FileSystemLoader
train
function FileSystemLoader(dir, options) { this.dir = dir.replace(/\/$/, ''); this.options = options || (options = {}); this.posts = []; this.files = {}; this.ignore = {}; var self = this;
javascript
{ "resource": "" }
q43569
Endpoint
train
function Endpoint() { var self = this; const subscriptions = {}; const ps = new Pubsub(); this._publish = ps.publish; this._subscribe = ps.subscribe; this.active = false; this.connections = []; /** * Publishes a new connection. * @function _newConnection * @private * @param {string} sID soc...
javascript
{ "resource": "" }
q43570
find
train
function find(queue, name) { const out = queue.findIndex(e => e.name === name); if (out === -1) {
javascript
{ "resource": "" }
q43571
insert
train
function insert(queue, index, fns, mode = InsertMode.REGULAR) { fns.forEach(({ fn, name }) => { if (queue.findIndex(e => e.name === name) !== -1) { throw new Error(`${name}: A function
javascript
{ "resource": "" }
q43572
addElement
train
function addElement( element, target, moveCurrent ) { target = target || currentNode || root; // Current element might be mangled by fix body below, // save it for restore later. var savedCurrent = currentNode; // Ignore any element that has already been added. if ( element.previous === undefined ) ...
javascript
{ "resource": "" }
q43573
checkAutoParagraphing
train
function checkAutoParagraphing( parent, node ) { // Check for parent that can contain block. if ( ( parent == root || parent.name == 'body' ) && fixingBlock && ( !parent.name || CKEDITOR.dtd[ parent.name ][ fixingBlock ] ) ) { var name, realName; if ( node.attributes && ( realName = node.attributes...
javascript
{ "resource": "" }
q43574
possiblySibling
train
function possiblySibling( tag1, tag2 ) { if ( tag1 in CKEDITOR.dtd.$listItem || tag1 in CKEDITOR.dtd.$tableContent ) return tag1 == tag2
javascript
{ "resource": "" }
q43575
train
function( filter, context ) { context = this.getFilterContext( context ); // Apply the root filter.
javascript
{ "resource": "" }
q43576
train
function( filter, filterRoot, context ) { // If this element's children were already filtered // by current filter, don't filter them 2nd time. // This situation may occur when filtering bottom-up // (filterChildren() called manually in element's filter), // or in unpredictable edge cases when filter ...
javascript
{ "resource": "" }
q43577
train
function( writer, filter, filterRoot ) { var context = this.getFilterContext(); // Filtering root if enforced. if ( filterRoot && !this.parent && filter ) filter.onRoot( context, this ); if ( filter )
javascript
{ "resource": "" }
q43578
mr
train
function mr(bundler) { var prevError = null var pending = null var buffer = null build() // bundler.on('update', update) return handler /** * Build the CSS and pass it to `buffer`. * * @api private */ function build() { const p = pending = new Emitter() buffer = bundler.toString() ...
javascript
{ "resource": "" }
q43579
build
train
function build() { const p = pending = new Emitter() buffer = bundler.toString() if (p !==
javascript
{ "resource": "" }
q43580
deletePropertyAt
train
function deletePropertyAt(object, prop) { if (object == null) { return object; } var value =
javascript
{ "resource": "" }
q43581
DotCfg
train
function DotCfg(namespace, scope, strategy) { if (instanceOf(DotCfg, this)) { if (exotic(namespace)) { strategy = scope; scope = namespace; namespace = undefined; } if (primitive(scope)) { scope = env; } if (string(namespace)) { scope[namespace] = scope[namespace] || {}; scope =...
javascript
{ "resource": "" }
q43582
set
train
function set(notation, value, strategy) { var this$1 = this; var fn = !undef(value) && callable(strategy) ? strategy : this.strategy; if (object(notation)) {
javascript
{ "resource": "" }
q43583
get
train
function get(notation, defaultValue) { var value = read(this.scope, notation);
javascript
{ "resource": "" }
q43584
makeArrayOpt
train
function makeArrayOpt(opts, name) { if( !Array.isArray(opts[name]) ) { opts[name]
javascript
{ "resource": "" }
q43585
rethrow
train
function rethrow(options) { var opts = lazy.extend({before: 3, after: 3}, options); return function (err, filename, lineno, str, expr) { if (!(err instanceof Error)) throw err; lineno = lineno >> 0; var lines = str.split('\n'); var before = Math.max(lineno - (+opts.before), 0); var after = Math...
javascript
{ "resource": "" }
q43586
processRelativePath
train
function processRelativePath(cssPath, importCssPath, importCssText) { cssPath = cssPath.split('\\'); importCssPath = importCssPath.split('/'); var isSibling = importCssPath.length == 1; return importCssText.replace(reg, function(css, before, imgPath, after) { if (/^http\S/.te...
javascript
{ "resource": "" }
q43587
getRelativePath
train
function getRelativePath(cssPath, importCssPath, imgPath) { var count1 = 0, count2 = 0, result = ''; importCssPath = getFilePath(cssPath, importCssPath); imgPath = getFilePath(importCssPath, imgPath); for (var i = 0, length = cssPath.length; i < length; i++) { ...
javascript
{ "resource": "" }
q43588
getFilePath
train
function getFilePath(basePath, relativePath) { var count = 0, array1, array2; for (var i = 0, length = relativePath.length; i < length; i++) {
javascript
{ "resource": "" }
q43589
copy
train
function copy(obj, map) { if (map.has(obj)) { return map.get(obj); } else if (Array.isArray(obj)) { const result = []; map.set(obj, result); obj.forEach(item => { result.push(copy(item, map)); }); return result; } else if (typeof obj === 'object' &...
javascript
{ "resource": "" }
q43590
parseSearchResults
train
function parseSearchResults(err, body) { if (err) { return tubesio.finish(err); } var result = []; jsdom.env({ html: body, scripts: [ 'http://code.jquery.com/jquery-1.5.min.js' ] }, function (err, window) { if (err) { return tubesio.finish(err); } v...
javascript
{ "resource": "" }
q43591
inherits
train
function inherits(ctor, superCtor, staticInherit) { var v = (ctor.hasOwnProperty('super_') && ctor.super_) || getPrototypeOf(ctor); var mixinCtor = ctor.mixinCtor_; if (mixinCtor && v === mixinCtor) { ctor = mixinCtor; v = (ctor.hasOwnProperty('super_') && ctor.super_) || getPrototypeOf(ctor); } var ...
javascript
{ "resource": "" }
q43592
train
function( text ) { if ( this.$.text != null ) this.$.text += text; else
javascript
{ "resource": "" }
q43593
train
function( parent ) { var range = new CKEDITOR.dom.range( this.getDocument() ); // We'll be extracting part of this element, so let's use our // range to get the correct piece. range.setStartAfter( this );
javascript
{ "resource": "" }
q43594
train
function() { // http://help.dottoro.com/ljvmcrrn.php var rect = CKEDITOR.tools.extend( {}, this.$.getBoundingClientRect() ); !rect.width && ( rect.width
javascript
{ "resource": "" }
q43595
train
function( otherElement ) { // do shallow clones, but with IDs var thisEl = this.clone( 0, 1 ), otherEl = otherElement.clone( 0, 1 ); // Remove distractions. thisEl.removeAttributes( [ '_moz_dirty', 'data-cke-expando', 'data-cke-saved-href', 'data-cke-saved-name' ] ); otherEl.removeAttributes( [ '_mo...
javascript
{ "resource": "" }
q43596
train
function() { // CSS unselectable. this.setStyles( CKEDITOR.tools.cssVendorPrefix( 'user-select', 'none' ) ); // For IE/Opera which doesn't support for the above CSS style, // the unselectable="on" attribute only specifies the selection // process cannot start in the element itself, and it doesn't inheri...
javascript
{ "resource": "" }
q43597
train
function( alignToTop ) { var parent = this.getParent(); if ( !parent ) return; // Scroll the element into parent container from the inner out. do { // Check ancestors that overflows. var overflowed = parent.$.clientWidth && parent.$.clientWidth < parent.$.scrollWidth || parent.$.clien...
javascript
{ "resource": "" }
q43598
scrollBy
train
function scrollBy( x, y ) { // Webkit doesn't support "scrollTop/scrollLeft" // on documentElement/body element.
javascript
{ "resource": "" }
q43599
screenPos
train
function screenPos( element, refWin ) { var pos = { x: 0, y: 0 }; if ( !( element.is( isQuirks ? 'body' : 'html' ) ) ) { var box = element.$.getBoundingClientRect(); pos.x = box.left, pos.y = box.top; } var win = element.getWindow(); if ( !win.equals( refWin ) ) {
javascript
{ "resource": "" }