_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
52
373k
language
stringclasses
1 value
meta_information
dict
q19000
preloadLibrarySync
train
function preloadLibrarySync(libConfig) { libConfig = evalLibConfig(libConfig); var lib = libConfig.name, fileType = libConfig.fileType, libPackage = lib.replace(/\./g, '/'), libLoaded = !!sap.ui.loader._.getModuleState(libPackage + '/library.js'); if ( fileType === 'none' || libLoaded ) { return; ...
javascript
{ "resource": "" }
q19001
getModulePath
train
function getModulePath(sModuleName, sSuffix){ return sap.ui.require.toUrl(sModuleName.replace(/\./g, "/") + sSuffix); }
javascript
{ "resource": "" }
q19002
train
function(bAsKeyUser) { var oDescriptor = fnGetDescriptor(); return new Promise(function(resolve) { var fnCancel = function() { AppVariantUtils.closeOverviewDialog(); }; sap.ui.require(["sap/ui/rta/appVariant/AppVariantOverviewDialog"], function(AppVariantOverviewDialog) { if (!oAppVariantOv...
javascript
{ "resource": "" }
q19003
processArray
train
function processArray(aPromises) { return aPromises.reduce(function(pacc, fn) { return pacc.then(fn); }, Promise.resolve()) .catch(function() { return Promise.resolve(false); }); }
javascript
{ "resource": "" }
q19004
_stringify
train
function _stringify(vObject) { var sData = "", sProp; var type = typeof vObject; if (vObject == null || (type != "object" && type != "function")) { sData = vObject; } else if (isPlainObject(vObject)) { sData = JSON.stringify(vObject); } else if (vObject instanceof ManagedObject) { sData = vObject.ge...
javascript
{ "resource": "" }
q19005
train
function(oContext) { // use the id of the ManagedObject instance as the identifier // for the extended change detection var oObject = oContext.getObject(); if (oObject instanceof ManagedObject) { return oObject.getId(); } return JSONListBinding.prototype.getEntryKey.apply(this, arguments); }
javascript
{ "resource": "" }
q19006
train
function(iStartIndex, iLength) { var iSizeLimit; if (this._oAggregation) { var oInnerListBinding = this._oOriginMO.getBinding(this._sMember); //check if the binding is a list binding if (oInnerListBinding) { var oModel = oInnerListBinding.getModel(); iSizeLimit = oModel.iSizeLimit; } ...
javascript
{ "resource": "" }
q19007
train
function (oContext) { if (oContext) { oControl = oContext; oControl.addDelegate(this._controlDelegate, false, this); } this.oRb = Core.getLibraryResourceBundle("sap.f"); }
javascript
{ "resource": "" }
q19008
train
function (aRequests) { var oBatchRequest = _serializeBatchRequest(aRequests); return { body : oBatchRequest.body.join(""), headers : { "Content-Type" : "multipart/mixed; boundary=" + oBatchRequest.batchBoundary, "MIME-Version" : "1.0" } }; }
javascript
{ "resource": "" }
q19009
train
function(aEnum, oEnumComparison) { if (aEnum && Array.isArray(aEnum) && aEnum.length) { for (var i = 0; i < aEnum.length; i++) { if (oEnumComparison.hasOwnProperty(aEnum[i])) { continue; } else { return false; } } return true; } return false; }
javascript
{ "resource": "" }
q19010
train
function(sId) { //Match camelCase - case sensitive var idRegEx = /^[a-z][a-zA-Z]+$/; if ( !sId || typeof sId !== 'string') { return false; } if (sId.match(idRegEx) && this.validateStringLength(sId, 6, 50)) { return true; } return false; }
javascript
{ "resource": "" }
q19011
cell
train
function cell(oContent) { return new MatrixLayoutCell({ padding: Padding.None, vAlign: VAlign.Top, content: oContent }); }
javascript
{ "resource": "" }
q19012
image
train
function image(oIcon) { var oImage = new Image({ id: sDialogId + "--icon", tooltip: rb && rb.getText("MSGBOX_ICON_" + oIcon), decorative: true }); oImage.addStyleClass("sapUiMboxIcon"); oImage.addStyleClass(mIconClass[oIcon]); return oImage; }
javascript
{ "resource": "" }
q19013
train
function(sEmail, sSubject, sBody, sCC, sBCC) { var aParams = [], sURL = "mailto:", encode = encodeURIComponent; // Within mailto URLs, the characters "?", "=", "&" are reserved isValidString(sEmail) && (sURL += encode(jQuery.trim(sEmail))); isValidString(sSubject) && aParams.push("subject=" +...
javascript
{ "resource": "" }
q19014
train
function (sURL, bNewWindow) { assert(isValidString(sURL), this + "#redirect: URL must be a string" ); this.fireEvent("redirect", sURL); if (!bNewWindow) { window.location.href = sURL; } else { var oWindow = window.open(sURL, "_blank"); if (!oWindow) { Log.error(this + "#redirect: Co...
javascript
{ "resource": "" }
q19015
checkAndSetProperty
train
function checkAndSetProperty(oControl, property, value) { if (value !== undefined) { var fSetter = oControl['set' + capitalize(property)]; if (typeof (fSetter) === "function") { fSetter.call(oControl, value); return true; } } return false; }
javascript
{ "resource": "" }
q19016
train
function(sPercentage, fBaseSize){ if (typeof sPercentage !== "string") { Log.warning("sap.m.PopupHelper: calcPercentageSize, the first parameter" + sPercentage + "isn't with type string"); return null; } if (sPercentage.indexOf("%") <= 0) { Log.warning("sap.m.PopupHelper: calcPercentageSize, the f...
javascript
{ "resource": "" }
q19017
isGridSupportedByBrowser
train
function isGridSupportedByBrowser() { return !Device.browser.msie && !(Device.browser.edge && Device.browser.version < EDGE_VERSION_WITH_GRID_SUPPORT); }
javascript
{ "resource": "" }
q19018
train
function (oEvent) { if (this._oView) { this._oView.destroy(); // If we had a view that means this is a navigation so we need to init the busy state this._oContainerPage.setBusy(true); } var oComponent = this.getOwnerComponent(); this._sTopicid = decodeURIComponent(oEvent.getParameter("a...
javascript
{ "resource": "" }
q19019
train
function (oView) { var oController = oView.getController(); // Add the sub view to the current one this._oContainerPage.addContent(oView); this._oContainerPage.setBusy(false); // Init the sub view and controller with the needed references.The view's are nested and work in a // mimic way so the...
javascript
{ "resource": "" }
q19020
train
function (oBorrowedData) { // Attach resolved borrowed data this._oControlData.borrowed = oBorrowedData; // Pre-process data and create model this._bindData(this._sTopicid); // Create the sub-view and controller this._oView = sap.ui.view({ height: "100%", viewName: "sap.ui.documentat...
javascript
{ "resource": "" }
q19021
train
function (aLibsData) { var oLibItem, iLen, i; // Find entity in loaded libs data for (i = 0, iLen = aLibsData.length; i < iLen; i++) { oLibItem = aLibsData[i]; if (oLibItem.name === this._sTopicid) { // Check if we are allowed to display the requested symbol // BCP: 18702690...
javascript
{ "resource": "" }
q19022
train
function (aData) { var oEntityData, oMasterController, sTopicId = this._sTopicid; // Cache api-index data this._aApiIndex = aData; // Find symbol function findSymbol (a) { return a.some(function (o) { var bFound = o.name === sTopicId; if (!bFound && o.nodes) { ret...
javascript
{ "resource": "" }
q19023
train
function (aElements, fnFilter, fnFormat) { var i, iLength = aElements.length, aNewElements = [], oElement; for (i = 0; i < iLength; i++) { oElement = aElements[i]; if (fnFilter && !fnFilter(oElement)) { continue; } if (fnFormat) { fnFormat(oElement); } ...
javascript
{ "resource": "" }
q19024
preloadModules
train
function preloadModules (oData) { // prealod the modules from the live-edited src sap.ui.require.preload(oData.src); // require the init module sap.ui.require([oData.moduleNameToRequire]); }
javascript
{ "resource": "" }
q19025
addOnErrorHook
train
function addOnErrorHook () { window.addEventListener("error", function(error) { error.preventDefault(); var oErrorOutput = document.createElement("span"); oErrorOutput.innerText = error.message; // use save API oErrorOutput.style.cssText = "position:absolute; top:1rem; left:1rem"; if (!document.body) ...
javascript
{ "resource": "" }
q19026
Version
train
function Version(vMajor, iMinor, iPatch, sSuffix) { if ( vMajor instanceof Version ) { // note: even a constructor may return a value different from 'this' return vMajor; } if ( !(this instanceof Version) ) { // act as a cast operator when called as function (not as a constructor) return new Version(v...
javascript
{ "resource": "" }
q19027
train
function(sLogType, aMessageComponents, aValuesToInsert, sCallStack) { var sLogMessage = aMessageComponents.join(' '); sLogMessage = formatMessage(sLogMessage, aValuesToInsert); this.log[sLogType](sLogMessage, sCallStack || ""); }
javascript
{ "resource": "" }
q19028
train
function (oControl) { var oModel; if (!oControl) { return ""; } // Get Model if (oControl && typeof oControl.getModel === "function") { oModel = oControl.getModel(); return Utils._getXSRFTokenFromModel(oModel); } return ""; }
javascript
{ "resource": "" }
q19029
train
function (oModel) { var mHeaders; if (!oModel) { return ""; } if (typeof oModel.getHeaders === "function") { mHeaders = oModel.getHeaders(); if (mHeaders) { return mHeaders["x-csrf-token"]; } } return ""; }
javascript
{ "resource": "" }
q19030
train
function (oControl) { var oAppComponent; // determine UI5 component out of given control if (oControl) { // always return the app component oAppComponent = this.getAppComponentForControl(oControl); // check if the component is an application variant and assigned an application descriptor then use...
javascript
{ "resource": "" }
q19031
train
function (oControl) { var oManifest = null, oComponent = null, oComponentMetaData = null; // determine UI5 component out of given control if (oControl) { oComponent = this.getAppComponentForControl(oControl); // determine manifest out of found component if (oComponent && oComponent.getMetadata) {...
javascript
{ "resource": "" }
q19032
train
function (oControl) { var sSiteId = null, oAppComponent = null; // determine UI5 component out of given control if (oControl) { oAppComponent = this.getAppComponentForControl(oControl); // determine siteId from ComponentData if (oAppComponent) { //Workaround for back-end check: isApplicatio...
javascript
{ "resource": "" }
q19033
train
function (sPropertyValue) { var bIsBinding = false; if (sPropertyValue && typeof sPropertyValue === "string" && sPropertyValue.substring(0, 1) === "{" && sPropertyValue.slice(-1) === "}") { bIsBinding = true; } return bIsBinding; }
javascript
{ "resource": "" }
q19034
train
function (oControl) { var sFlexReference = Utils.getComponentClassName(oControl); var oAppComponent = Utils.getAppComponentForControl(oControl); var sComponentName = Utils.getComponentName(oAppComponent); return sFlexReference !== sComponentName; }
javascript
{ "resource": "" }
q19035
train
function (oComponent, sParameterName) { var startUpParameterContent = null; if (sParameterName) { if (oComponent && oComponent.getComponentData) { startUpParameterContent = this._getStartUpParameter(oComponent.getComponentData(), sParameterName); } } return startUpParameterContent; }
javascript
{ "resource": "" }
q19036
train
function (oComponent) { var sComponentName = ""; if (oComponent) { sComponentName = oComponent.getMetadata().getName(); } if (sComponentName.length > 0 && sComponentName.indexOf(".Component") < 0) { sComponentName += ".Component"; } return sComponentName; }
javascript
{ "resource": "" }
q19037
train
function (oControl) { var sComponentId = Utils._getOwnerIdForControl(oControl); if (!sComponentId) { if (oControl && typeof oControl.getParent === "function") { var oParent = oControl.getParent(); if (oParent) { return Utils._getComponentIdForControl(oParent); } } } return sComp...
javascript
{ "resource": "" }
q19038
train
function (oControl) { var oComponent = null; var sComponentId = null; // determine UI5 component out of given control if (oControl) { sComponentId = Utils._getComponentIdForControl(oControl); if (sComponentId) { oComponent = Utils._getComponent(sComponentId); } } return oComponent; ...
javascript
{ "resource": "" }
q19039
train
function (oComponent) { var oSapApp = null; // special case for Fiori Elements to reach the real appComponent if (oComponent && oComponent.getAppComponent) { return oComponent.getAppComponent(); } // special case for OVP if (oComponent && oComponent.oComponentData && oComponent.oComponentData.app...
javascript
{ "resource": "" }
q19040
train
function (bIsEndUser) { var oUriParams, sLayer; if (bIsEndUser) { return "USER"; } oUriParams = this._getUriParameters(); sLayer = oUriParams.get("sap-ui-layer") || ""; sLayer = sLayer.toUpperCase(); return sLayer || "CUSTOMER"; }
javascript
{ "resource": "" }
q19041
train
function (oControl) { var oMetadata; if (oControl && typeof oControl.getMetadata === "function") { oMetadata = oControl.getMetadata(); if (oMetadata && typeof oMetadata.getElementName === "function") { return oMetadata.getElementName(); } } }
javascript
{ "resource": "" }
q19042
train
function (ascii) { var asciiArray = ascii.split(","); var parsedString = ""; jQuery.each(asciiArray, function (index, asciiChar) { parsedString += String.fromCharCode(asciiChar); }); return parsedString; }
javascript
{ "resource": "" }
q19043
train
function (string) { var ascii = ""; for (var i = 0; i < string.length; i++) { ascii += string.charCodeAt(i) + ","; } // remove last "," ascii = ascii.substring(0, ascii.length - 1); return ascii; }
javascript
{ "resource": "" }
q19044
train
function(){ var oUshellContainer = Utils.getUshellContainer(); if (oUshellContainer) { var oURLParser = oUshellContainer.getService("URLParsing"); var oParsedHash = oURLParser.parseShellHash(hasher.getHash()); return oParsedHash ? oParsedHash : { }; } return { }; }
javascript
{ "resource": "" }
q19045
train
function (oComponent, sParameterName, aValues) { var oParsedHash = Utils.getParsedURLHash(sParameterName); if (oParsedHash.params) { hasher.changed.active = false; //disable changed signal var mTechnicalParameters = Utils.getTechnicalParametersForComponent(oComponent); // if mTechnicalParameter...
javascript
{ "resource": "" }
q19046
train
function (mPropertyBag) { var sAppVersion = mPropertyBag.appVersion; var bDeveloperMode = mPropertyBag.developerMode; var sScenario = mPropertyBag.scenario; var oValidAppVersions = { creation: sAppVersion, from: sAppVersion }; if (this._isValidAppVersionToRequired(sAppVersion, bDeveloperMode, ...
javascript
{ "resource": "" }
q19047
train
function (sAppVersion, bDeveloperMode, sScenario) { return !!sAppVersion && !!bDeveloperMode && sScenario !== sap.ui.fl.Scenario.AdaptationProject && sScenario !== sap.ui.fl.Scenario.AppVariant; }
javascript
{ "resource": "" }
q19048
train
function (oManifest) { var sUri = ""; if (oManifest){ var oSapApp = (oManifest.getEntry) ? oManifest.getEntry("sap.app") : oManifest["sap.app"]; if (oSapApp && oSapApp.dataSources && oSapApp.dataSources.mainService && oSapApp.dataSources.mainService.uri){ sUri = oSapApp.dataSources.mainService.uri; ...
javascript
{ "resource": "" }
q19049
train
function(aArray, oObject) { var iObjectIndex = -1; aArray.some(function(oArrayObject, iIndex) { var aKeysArray, aKeysObject; if (!oArrayObject) { aKeysArray = []; } else { aKeysArray = Object.keys(oArrayObject); } if (!oObject) { aKeysObject = []; } else { aKeysObject ...
javascript
{ "resource": "" }
q19050
train
function(mChanges, sChangeId) { var oResult; Object.keys(mChanges).forEach(function(sControlId) { mChanges[sControlId].some(function(oChange) { if (oChange.getId() === sChangeId) { oResult = oChange; return true; } }); }); return oResult; }
javascript
{ "resource": "" }
q19051
train
function(sModuleName) { //TODO: get rid of require async as soon as sap.ui.require has learned Promises as return value return new Promise(function(fnResolve, fnReject) { sap.ui.require([sModuleName], function(oModule) { fnResolve(oModule); }, function(oError) { fnReject(oError); }); ...
javascript
{ "resource": "" }
q19052
train
function (mMap, sPath, oItem) { if (oItem) { if (!mMap[sPath]) { mMap[sPath] = [oItem]; } else if (mMap[sPath].indexOf(oItem) < 0) { mMap[sPath].push(oItem); } } }
javascript
{ "resource": "" }
q19053
train
function (aChildren, aAncestors, mChildren) { if (aAncestors.length) { aChildren.forEach(function (sPath) { var aSegments; if (aAncestors.indexOf(sPath) >= 0) { mChildren[sPath] = true; return; } aSegments = sPath.split("/"); aSegments.pop(); while (aSegments.length) {...
javascript
{ "resource": "" }
q19054
train
function () { var i, sPath = "", sSegment; for (i = 0; i < arguments.length; i += 1) { sSegment = arguments[i]; if (sSegment || sSegment === 0) { if (sPath && sPath !== "/" && sSegment[0] !== "(") { sPath += "/"; } sPath += sSegment; } } return sPath; }
javascript
{ "resource": "" }
q19055
train
function (sPart, bEncodeEquals) { var sEncoded = encodeURI(sPart) .replace(rAmpersand, "%26") .replace(rHash, "%23") .replace(rPlus, "%2B"); if (bEncodeEquals) { sEncoded = sEncoded.replace(rEquals, "%3D"); } return sEncoded; }
javascript
{ "resource": "" }
q19056
train
function (sKey, sValue) { return _Helper.encode(sKey, true) + "=" + _Helper.encode(sValue, false); }
javascript
{ "resource": "" }
q19057
train
function (mChangeListeners, sPropertyPath, vValue) { var aListeners = mChangeListeners[sPropertyPath], i; if (aListeners) { for (i = 0; i < aListeners.length; i += 1) { aListeners[i].onChange(vValue); } } }
javascript
{ "resource": "" }
q19058
train
function (mChangeListeners, sPath, oValue, bRemoved) { Object.keys(oValue).forEach(function (sProperty) { var sPropertyPath = _Helper.buildPath(sPath, sProperty), vValue = oValue[sProperty]; if (vValue && typeof vValue === "object") { _Helper.fireChanges(mChangeListeners, sPropertyPath, vValue, bR...
javascript
{ "resource": "" }
q19059
train
function (vValue, sType) { if (vValue === undefined) { throw new Error("Illegal value: undefined"); } if (vValue === null) { return "null"; } switch (sType) { case "Edm.Binary": return "binary'" + vValue + "'"; case "Edm.Boolean": case "Edm.Byte": case "Edm.Double": case "Edm...
javascript
{ "resource": "" }
q19060
train
function (oInstance, sMetaPath, mTypeForMetaPath) { var aFilters = [], sKey, mKey2Value = _Helper.getKeyProperties(oInstance, sMetaPath, mTypeForMetaPath); if (!mKey2Value) { return undefined; } for (sKey in mKey2Value) { aFilters.push(sKey + " eq " + mKey2Value[sKey]); } return aFil...
javascript
{ "resource": "" }
q19061
train
function (oInstance, sMetaPath, mTypeForMetaPath, bReturnAlias) { var bFailed, mKey2Value = {}; bFailed = mTypeForMetaPath[sMetaPath].$Key.some(function (vKey) { var sKey, sKeyPath, aPath, sPropertyName, oType, vValue; if (typeof vKey === "string") { sKey = sKeyPath = vKey; } else { sK...
javascript
{ "resource": "" }
q19062
train
function (mQueryOptions, sPath) { sPath = sPath[0] === "(" ? _Helper.getMetaPath(sPath).slice(1) // avoid leading "/" : _Helper.getMetaPath(sPath); if (sPath) { sPath.split("/").some(function (sSegment) { mQueryOptions = mQueryOptions && mQueryOptions.$expand && mQueryOptions.$expand[sSegme...
javascript
{ "resource": "" }
q19063
train
function (iNumber) { if (typeof iNumber !== "number" || !isFinite(iNumber)) { return false; } iNumber = Math.abs(iNumber); // The safe integers consist of all integers from -(2^53 - 1) inclusive to 2^53 - 1 // inclusive. // 2^53 - 1 = 9007199254740991 return iNumber <= 9007199254740991 && Math....
javascript
{ "resource": "" }
q19064
train
function (sUrl, sBase) { return new URI(sUrl).absoluteTo(sBase).toString() .replace(rEscapedTick, "'") .replace(rEscapedOpenBracket, "(") .replace(rEscapedCloseBracket, ")"); }
javascript
{ "resource": "" }
q19065
train
function (sName) { var iIndex = sName.indexOf("/"); if (iIndex >= 0) { // consider only the first path segment sName = sName.slice(0, iIndex); } // now we have a qualified name, drop the last segment (the name) iIndex = sName.lastIndexOf("."); return iIndex < 0 ? "" : sName.slice(0, iIndex);...
javascript
{ "resource": "" }
q19066
train
function (sLiteral, sType, sPath) { function checkNaN(nValue) { if (!isFinite(nValue)) { // this rejects NaN, Infinity, -Infinity throw new Error(sPath + ": Not a valid " + sType + " literal: " + sLiteral); } return nValue; } if (sLiteral === "null") { return null; } switch (sType...
javascript
{ "resource": "" }
q19067
train
function (mMap, sPath, oItem) { var aItems = mMap[sPath], iIndex; if (aItems) { iIndex = aItems.indexOf(oItem); if (iIndex >= 0) { if (aItems.length === 1) { delete mMap[sPath]; } else { aItems.splice(iIndex, 1); } } } }
javascript
{ "resource": "" }
q19068
train
function (mHeaders) { var vIfMatchValue = mHeaders && mHeaders["If-Match"]; if (vIfMatchValue && typeof vIfMatchValue === "object") { vIfMatchValue = vIfMatchValue["@odata.etag"]; mHeaders = Object.assign({}, mHeaders); if (vIfMatchValue === undefined) { delete mHeaders["If-Match"]; } else {...
javascript
{ "resource": "" }
q19069
train
function (oObject, sAnnotation, vValue) { var oPrivateNamespace = oObject["@$ui5._"]; if (!oPrivateNamespace) { oPrivateNamespace = oObject["@$ui5._"] = {}; } oPrivateNamespace[sAnnotation] = vValue; }
javascript
{ "resource": "" }
q19070
train
function (mMap, sTransientPredicate, sPredicate) { var sPath; for (sPath in mMap) { if (sPath.includes(sTransientPredicate)) { // A path may contain multiple different transient predicates ($uid=...) but a // certain transient predicate can only be once in the path and cannot collide // with a...
javascript
{ "resource": "" }
q19071
train
function () { var oObjectPageLayoutInstance = null; if (this._oComponent && this._oComponent._oView) { oObjectPageLayoutInstance = this._oComponent._oView.byId("ObjectPageLayout"); } else { Log.error("ObjectPageComponentContainer :: cannot find children ObjectPageLayout, has it been rendered alrea...
javascript
{ "resource": "" }
q19072
ODataBinding
train
function ODataBinding() { // maps a canonical path of a quasi-absolute or relative binding to a cache object that may // be reused this.mCacheByResourcePath = undefined; this.oCachePromise = SyncPromise.resolve(); this.mCacheQueryOptions = undefined; // used to create cache only for the latest call to #fetc...
javascript
{ "resource": "" }
q19073
train
function(oDragSession, oSessionData, sKey) { oDragSession.setComplexData(SESSION_DATA_KEY_NAMESPACE + (sKey == null ? "" : "-" + sKey), oSessionData); }
javascript
{ "resource": "" }
q19074
expandVertically
train
function expandVertically() { var growWith = 0; for (var i = 0; i < this.virtualGridMatrix.length; i++) { if (this.virtualGridMatrix[i][0] !== 0) { growWith++; } } if (growWith > 0) { this.addEmptyRows(growWith); } }
javascript
{ "resource": "" }
q19075
collectHeaderSpans
train
function collectHeaderSpans(oColumn, index, aCols) { var colSpan = TableUtils.Column.getHeaderSpan(oColumn, iRow), iColIndex; if (nSpan < 1) { if (colSpan > 1) { // In case when a user makes some of the underlying columns invisible, adjust colspan iColIndex = oColumn.getIndex(); colSpan = ...
javascript
{ "resource": "" }
q19076
isForbiddenType
train
function isForbiddenType(sType) { var aTypes = [ButtonType.Up, ButtonType.Back, ButtonType.Unstyled]; return aTypes.indexOf(sType) !== -1; }
javascript
{ "resource": "" }
q19077
_applyTriggerHook
train
function _applyTriggerHook(sEventType) { if (!jQuery.event.special[sEventType]) { jQuery.event.special[sEventType] = {}; } var oSpecialEvent = jQuery.event.special[sEventType], originalTriggerHook = oSpecialEvent.trigger; oSpecialEvent.trigger = fnTriggerHook; return originalTriggerHook; }
javascript
{ "resource": "" }
q19078
suppressTriggeredEvent
train
function suppressTriggeredEvent(sEventType, oDomRef, aExcludedDomRefs) { var mEventInfo = mTriggerEventInfo[sEventType]; var sId = uid(); if (!mEventInfo) { mEventInfo = mTriggerEventInfo[sEventType] = { domRefs: {}, originalTriggerHook: _applyTriggerHook(sEventType) }; } mEventInfo.domRefs[sI...
javascript
{ "resource": "" }
q19079
releaseTriggeredEvent
train
function releaseTriggeredEvent(oHandler) { if (!oHandler) { Log.error("Release trigger events must not be called without passing a valid handler!"); return; } var mEventInfo = mTriggerEventInfo[oHandler.type]; if (!mEventInfo) { return; } else if (!mEventInfo.domRefs[oHandler.id] || !mEventInfo.dom...
javascript
{ "resource": "" }
q19080
fetchIndex
train
function fetchIndex() { return new Promise(function(resolve, reject) { var oIndex = oIndexCache["index"], oSerializedIndex; if (oIndex) { resolve(oIndex); return; } var req = new XMLHttpRequest(), onload = function (oEvent) { oSerializedIndex = oEvent.target.response || oEvent.t...
javascript
{ "resource": "" }
q19081
searchIndex
train
function searchIndex(sQuery) { sQuery = preprocessQuery(sQuery); return new Promise(function(resolve, reject) { fetchIndex().then(function(oIndex) { var aSearchResults, oSearchResultsCollector = new SearchResultCollector(); function searchByField(sFieldToSearch, sSubQuery, bReturnMatchedDocWord...
javascript
{ "resource": "" }
q19082
overrideLunrTokenizer
train
function overrideLunrTokenizer() { var origTokenizer = lunr.tokenizer; var rSeparators = /[-./#_,;\(\)=><|]/g; lunr.tokenizer = function(str) { return origTokenizer.call(lunr, str).reduce( function (result, token) { if ( rSeparators.test(token) ) { token = token.replace(rSeparators, " "); resul...
javascript
{ "resource": "" }
q19083
getObjectValues
train
function getObjectValues(oObject) { var aKeys = Object.keys(oObject), aValues = []; aKeys.forEach(function(sKey) { aValues.push(oObject[sKey]); }); return aValues; }
javascript
{ "resource": "" }
q19084
train
function (oTarget) { var iViewLevel; do { iViewLevel = oTarget._oOptions.viewLevel; if (iViewLevel !== undefined) { return iViewLevel; } oTarget = oTarget._oParent; } while (oTarget); return iViewLevel; }
javascript
{ "resource": "" }
q19085
train
function(oTable, vRowIndex, bExpand) { var aIndices = []; var oBinding = oTable ? oTable.getBinding("rows") : null; if (!oTable || !oBinding || !oBinding.expand || vRowIndex == null) { return null; } if (typeof vRowIndex === "number") { aIndices = [vRowIndex]; } else if (Array.isArray(vRowIn...
javascript
{ "resource": "" }
q19086
train
function(oCellRef) { var oInfo = TableGrouping.TableUtils.getCellInfo(oCellRef); if (oInfo.isOfType(TableGrouping.TableUtils.CELLTYPE.DATACELL)) { return oInfo.cell.parent().hasClass("sapUiTableGroupHeader"); } else if (oInfo.isOfType(TableGrouping.TableUtils.CELLTYPE.ROWHEADER | TableGrouping.TableUtils....
javascript
{ "resource": "" }
q19087
train
function(oTable, iLevel, bChildren, bSum) { var iIndent = 0; var i; if (oTable.isA("sap.ui.table.TreeTable")) { for (i = 0; i < iLevel; i++) { iIndent = iIndent + (i < 2 ? 12 : 8); } } else if (oTable.isA("sap.ui.table.AnalyticalTable")) { iLevel = iLevel - 1; iLevel = !bChildren && !b...
javascript
{ "resource": "" }
q19088
train
function(oTable, $Row, $RowHdr, iIndent) { var bRTL = oTable._bRtlMode, $FirstCellContentInRow = $Row.find("td.sapUiTableCellFirst > .sapUiTableCellInner"), $Shield = $RowHdr.find(".sapUiTableGroupShield"); if (iIndent <= 0) { // No indent -> Remove custom manipulations (see else) $RowHdr.css(bRT...
javascript
{ "resource": "" }
q19089
train
function(oTable, oRow, bChildren, bExpanded, bHidden, bSum, iLevel, sGroupHeaderText) { var oDomRefs = oRow.getDomRefs(true), $Row = oDomRefs.row, $ScrollRow = oDomRefs.rowScrollPart, $FixedRow = oDomRefs.rowFixedPart, $RowHdr = oDomRefs.rowSelector, $RowAct = oDomRefs.rowAction; $Row.attr({ ...
javascript
{ "resource": "" }
q19090
train
function(oTable) { var oBinding = oTable.getBinding("rows"); if (oBinding && oBinding._modified) { TableGrouping.clearMode(oTable); var oBindingInfo = oTable.getBindingInfo("rows"); oTable.unbindRows(); oTable.bindRows(oBindingInfo); } }
javascript
{ "resource": "" }
q19091
train
function (oEvent) { // both xml and html view write this ui5 internal property for the serializer if (oEvent.fFunction && oEvent.fFunction._sapui_handlerName) { var sHandlerName = oEvent.fFunction._sapui_handlerName; // double check that the function is on the controller var oController = oView.getC...
javascript
{ "resource": "" }
q19092
train
function (oControl) { // Allow specification of desired controlId as changing ids later on is not possible //This has to be the view relative ID if (oControl._sapui_controlId) { return oControl._sapui_controlId; } return oControl.getId().replace(oView.createId(""), ""); }
javascript
{ "resource": "" }
q19093
boot
train
function boot() { if (window.sap && window.sap.ui && window.sap.ui.getCore) { coreInstance = window.sap.ui.getCore(); return initTags(); } window.sap.ui.require(['/ui5loader-autoconfig', 'sap/ui/core/Core', 'sap/ui/integration/util/CustomElements'], function (config, Core, CE) { CustomElements = CE; ...
javascript
{ "resource": "" }
q19094
train
function () { var sJson = this._oStorage.get(this._sStorageKey); if (!sJson) { // local storage is empty, apply defaults this._oViewSettings = this._oDefaultSettings; } else { // parse this._oViewSettings = JSON.parse(sJson); // clean filter and remove values that do not exist any longe...
javascript
{ "resource": "" }
q19095
train
function(oTable) { var oScrollExtension = oTable._getScrollExtension(); var oHSb = oScrollExtension.getHorizontalScrollbar(); if (oHSb && internal(oTable).iHorizontalScrollPosition !== null) { var aScrollTargets = HorizontalScrollingHelper.getScrollAreas(oTable); for (var i = 0; i < aScrollTargets.le...
javascript
{ "resource": "" }
q19096
train
function(oTable) { var oDomRef = oTable.getDomRef(); var aScrollableColumnAreas; if (oDomRef) { aScrollableColumnAreas = Array.prototype.slice.call(oTable.getDomRef().querySelectorAll(".sapUiTableCtrlScr")); } var aScrollAreas = [ oTable._getScrollExtension().getHorizontalScrollbar() ].conca...
javascript
{ "resource": "" }
q19097
train
function(oEvent) { // For interaction detection. Interaction.notifyScrollEvent && Interaction.notifyScrollEvent(oEvent); if (internal(this).bIsScrolledVerticallyByKeyboard) { // When scrolling with the keyboard the first visible row is already correct and does not need adjustment. log("Vertical scroll...
javascript
{ "resource": "" }
q19098
train
function(oTable) { var oScrollExtension = oTable._getScrollExtension(); var iMaxFirstRenderedRowIndex = oTable._getMaxFirstRenderedRowIndex(); var iNewFirstVisibleRowIndex = VerticalScrollingHelper.getRowIndexAtCurrentScrollPosition(oTable); var iOldFirstVisibleRowIndex = oTable.getFirstVisibleRow(); var...
javascript
{ "resource": "" }
q19099
train
function(oTable) { var oScrollExtension = oTable._getScrollExtension(); var iMaxRowIndex = oTable._getMaxFirstVisibleRowIndex(); if (iMaxRowIndex === 0) { return 0; } else { var nScrollPosition = VerticalScrollingHelper.getScrollPosition(oTable); var iScrollRange = VerticalScrollingHelper.getSc...
javascript
{ "resource": "" }