id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
4,900
angular/material
docs/app/js/codepen.js
Codepen
function Codepen($demoAngularScripts, $document, codepenDataAdapter) { // The following URL used to be HTTP and not HTTPS to allow us to do localhost testing // It's no longer working, for more info: // https://blog.codepen.io/2017/03/31/codepen-going-https/ var CODEPEN_API = 'https://codepen.io/pen/de...
javascript
function Codepen($demoAngularScripts, $document, codepenDataAdapter) { // The following URL used to be HTTP and not HTTPS to allow us to do localhost testing // It's no longer working, for more info: // https://blog.codepen.io/2017/03/31/codepen-going-https/ var CODEPEN_API = 'https://codepen.io/pen/de...
[ "function", "Codepen", "(", "$demoAngularScripts", ",", "$document", ",", "codepenDataAdapter", ")", "{", "// The following URL used to be HTTP and not HTTPS to allow us to do localhost testing", "// It's no longer working, for more info:", "// https://blog.codepen.io/2017/03/31/codepen-goin...
Provides a service to open a code example in codepen.
[ "Provides", "a", "service", "to", "open", "a", "code", "example", "in", "codepen", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/docs/app/js/codepen.js#L7-L57
4,901
angular/material
docs/app/js/codepen.js
buildForm
function buildForm(data) { var form = angular.element( '<form style="display: none;" method="post" target="_blank" action="' + CODEPEN_API + '"></form>' ); var input = '<input type="hidden" name="data" value="' + escapeJsonQuotes(data) + '" />'; form.append(input); ...
javascript
function buildForm(data) { var form = angular.element( '<form style="display: none;" method="post" target="_blank" action="' + CODEPEN_API + '"></form>' ); var input = '<input type="hidden" name="data" value="' + escapeJsonQuotes(data) + '" />'; form.append(input); ...
[ "function", "buildForm", "(", "data", ")", "{", "var", "form", "=", "angular", ".", "element", "(", "'<form style=\"display: none;\" method=\"post\" target=\"_blank\" action=\"'", "+", "CODEPEN_API", "+", "'\"></form>'", ")", ";", "var", "input", "=", "'<input type=\"hi...
Builds a hidden form with data necessary to create a codepen.
[ "Builds", "a", "hidden", "form", "with", "data", "necessary", "to", "create", "a", "codepen", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/docs/app/js/codepen.js#L32-L41
4,902
angular/material
docs/app/js/codepen.js
processHtml
function processHtml(demo) { var allContent = demo.files.index.contents; var processors = [ applyAngularAttributesToParentElement, insertTemplatesAsScriptTags, htmlEscapeAmpersand ]; processors.forEach(function(processor) { allContent = processor(allContent, de...
javascript
function processHtml(demo) { var allContent = demo.files.index.contents; var processors = [ applyAngularAttributesToParentElement, insertTemplatesAsScriptTags, htmlEscapeAmpersand ]; processors.forEach(function(processor) { allContent = processor(allContent, de...
[ "function", "processHtml", "(", "demo", ")", "{", "var", "allContent", "=", "demo", ".", "files", ".", "index", ".", "contents", ";", "var", "processors", "=", "[", "applyAngularAttributesToParentElement", ",", "insertTemplatesAsScriptTags", ",", "htmlEscapeAmpersan...
Modifies index.html with necessary changes in order to display correctly in codepen See each processor to determine how each modifies the html
[ "Modifies", "index", ".", "html", "with", "necessary", "changes", "in", "order", "to", "display", "correctly", "in", "codepen", "See", "each", "processor", "to", "determine", "how", "each", "modifies", "the", "html" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/docs/app/js/codepen.js#L98-L113
4,903
angular/material
docs/app/js/codepen.js
processJs
function processJs(jsFiles) { var mergedJs = mergeFiles(jsFiles).join(' '); var script = replaceDemoModuleWithCodepenModule(mergedJs); return script; }
javascript
function processJs(jsFiles) { var mergedJs = mergeFiles(jsFiles).join(' '); var script = replaceDemoModuleWithCodepenModule(mergedJs); return script; }
[ "function", "processJs", "(", "jsFiles", ")", "{", "var", "mergedJs", "=", "mergeFiles", "(", "jsFiles", ")", ".", "join", "(", "' '", ")", ";", "var", "script", "=", "replaceDemoModuleWithCodepenModule", "(", "mergedJs", ")", ";", "return", "script", ";", ...
Applies modifications the javascript prior to sending to codepen. Currently merges js files and replaces the module with the Codepen module. See documentation for replaceDemoModuleWithCodepenModule.
[ "Applies", "modifications", "the", "javascript", "prior", "to", "sending", "to", "codepen", ".", "Currently", "merges", "js", "files", "and", "replaces", "the", "module", "with", "the", "Codepen", "module", ".", "See", "documentation", "for", "replaceDemoModuleWit...
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/docs/app/js/codepen.js#L148-L152
4,904
angular/material
docs/app/js/codepen.js
applyAngularAttributesToParentElement
function applyAngularAttributesToParentElement(html, demo) { var tmp; // Grab only the DIV for the demo... angular.forEach(angular.element(html), function(it,key){ if ((it.nodeName != "SCRIPT") && (it.nodeName != "#text")) { tmp = angular.element(it); } }); tmp....
javascript
function applyAngularAttributesToParentElement(html, demo) { var tmp; // Grab only the DIV for the demo... angular.forEach(angular.element(html), function(it,key){ if ((it.nodeName != "SCRIPT") && (it.nodeName != "#text")) { tmp = angular.element(it); } }); tmp....
[ "function", "applyAngularAttributesToParentElement", "(", "html", ",", "demo", ")", "{", "var", "tmp", ";", "// Grab only the DIV for the demo...", "angular", ".", "forEach", "(", "angular", ".", "element", "(", "html", ")", ",", "function", "(", "it", ",", "key...
Adds class to parent element so that styles are applied correctly Adds ng-app attribute. This is the same module name provided in the asset-cache.js
[ "Adds", "class", "to", "parent", "element", "so", "that", "styles", "are", "applied", "correctly", "Adds", "ng", "-", "app", "attribute", ".", "This", "is", "the", "same", "module", "name", "provided", "in", "the", "asset", "-", "cache", ".", "js" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/docs/app/js/codepen.js#L163-L176
4,905
angular/material
docs/app/js/codepen.js
insertTemplatesAsScriptTags
function insertTemplatesAsScriptTags(indexHtml, demo) { if (demo.files.html.length) { var tmp = angular.element(indexHtml); angular.forEach(demo.files.html, function(template) { tmp.append("<script type='text/ng-template' id='" + template.name + "'>" + ...
javascript
function insertTemplatesAsScriptTags(indexHtml, demo) { if (demo.files.html.length) { var tmp = angular.element(indexHtml); angular.forEach(demo.files.html, function(template) { tmp.append("<script type='text/ng-template' id='" + template.name + "'>" + ...
[ "function", "insertTemplatesAsScriptTags", "(", "indexHtml", ",", "demo", ")", "{", "if", "(", "demo", ".", "files", ".", "html", ".", "length", ")", "{", "var", "tmp", "=", "angular", ".", "element", "(", "indexHtml", ")", ";", "angular", ".", "forEach"...
Adds templates inline in the html, so that templates are cached in the example
[ "Adds", "templates", "inline", "in", "the", "html", "so", "that", "templates", "are", "cached", "in", "the", "example" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/docs/app/js/codepen.js#L179-L191
4,906
angular/material
src/components/colors/colors.js
parseColor
function parseColor(color, contrast) { contrast = contrast || false; var rgbValues = $mdTheming.PALETTES[color.palette][color.hue]; rgbValues = contrast ? rgbValues.contrast : rgbValues.value; return $mdUtil.supplant('rgba({0}, {1}, {2}, {3})', [rgbValues[0], rgbValues[1], rgbValues[2]...
javascript
function parseColor(color, contrast) { contrast = contrast || false; var rgbValues = $mdTheming.PALETTES[color.palette][color.hue]; rgbValues = contrast ? rgbValues.contrast : rgbValues.value; return $mdUtil.supplant('rgba({0}, {1}, {2}, {3})', [rgbValues[0], rgbValues[1], rgbValues[2]...
[ "function", "parseColor", "(", "color", ",", "contrast", ")", "{", "contrast", "=", "contrast", "||", "false", ";", "var", "rgbValues", "=", "$mdTheming", ".", "PALETTES", "[", "color", ".", "palette", "]", "[", "color", ".", "hue", "]", ";", "rgbValues"...
Return the parsed color @param {{hue: *, theme: any, palette: *, opacity: (*|string|number)}} color hash map of color definitions @param {boolean=} contrast whether use contrast color for foreground. Defaults to false. @returns {string} rgba color string
[ "Return", "the", "parsed", "color" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/colors/colors.js#L120-L129
4,907
angular/material
src/components/colors/colors.js
extractColorOptions
function extractColorOptions(expression) { var parts = expression.split('-'); var hasTheme = angular.isDefined($mdTheming.THEMES[parts[0]]); var theme = hasTheme ? parts.splice(0, 1)[0] : $mdTheming.defaultTheme(); return { theme: theme, palette: extractPalette(parts, theme), ...
javascript
function extractColorOptions(expression) { var parts = expression.split('-'); var hasTheme = angular.isDefined($mdTheming.THEMES[parts[0]]); var theme = hasTheme ? parts.splice(0, 1)[0] : $mdTheming.defaultTheme(); return { theme: theme, palette: extractPalette(parts, theme), ...
[ "function", "extractColorOptions", "(", "expression", ")", "{", "var", "parts", "=", "expression", ".", "split", "(", "'-'", ")", ";", "var", "hasTheme", "=", "angular", ".", "isDefined", "(", "$mdTheming", ".", "THEMES", "[", "parts", "[", "0", "]", "]"...
For the evaluated expression, extract the color parts into a hash map @param {string} expression color expression like 'red-800', 'red-A200-0.3', 'myTheme-primary', or 'myTheme-primary-400' @returns {{hue: *, theme: any, palette: *, opacity: (*|string|number)}}
[ "For", "the", "evaluated", "expression", "extract", "the", "color", "parts", "into", "a", "hash", "map" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/colors/colors.js#L175-L186
4,908
angular/material
src/components/colors/colors.js
extractPalette
function extractPalette(parts, theme) { // If the next section is one of the palettes we assume it's a two word palette // Two word palette can be also written in camelCase, forming camelCase to dash-case var isTwoWord = parts.length > 1 && colorPalettes.indexOf(parts[1]) !== -1; var palette = ...
javascript
function extractPalette(parts, theme) { // If the next section is one of the palettes we assume it's a two word palette // Two word palette can be also written in camelCase, forming camelCase to dash-case var isTwoWord = parts.length > 1 && colorPalettes.indexOf(parts[1]) !== -1; var palette = ...
[ "function", "extractPalette", "(", "parts", ",", "theme", ")", "{", "// If the next section is one of the palettes we assume it's a two word palette", "// Two word palette can be also written in camelCase, forming camelCase to dash-case", "var", "isTwoWord", "=", "parts", ".", "length"...
Calculate the theme palette name @param {Array} parts @param {string} theme name @return {string}
[ "Calculate", "the", "theme", "palette", "name" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/colors/colors.js#L194-L215
4,909
angular/material
src/components/tabs/js/tabsController.js
compileTemplate
function compileTemplate () { var template = $attrs.$mdTabsTemplate, element = angular.element($element[0].querySelector('md-tab-data')); element.html(template); $compile(element.contents())(ctrl.parent); delete $attrs.$mdTabsTemplate; }
javascript
function compileTemplate () { var template = $attrs.$mdTabsTemplate, element = angular.element($element[0].querySelector('md-tab-data')); element.html(template); $compile(element.contents())(ctrl.parent); delete $attrs.$mdTabsTemplate; }
[ "function", "compileTemplate", "(", ")", "{", "var", "template", "=", "$attrs", ".", "$mdTabsTemplate", ",", "element", "=", "angular", ".", "element", "(", "$element", "[", "0", "]", ".", "querySelector", "(", "'md-tab-data'", ")", ")", ";", "element", "....
Compiles the template provided by the user. This is passed as an attribute from the tabs directive's template function.
[ "Compiles", "the", "template", "provided", "by", "the", "user", ".", "This", "is", "passed", "as", "an", "attribute", "from", "the", "tabs", "directive", "s", "template", "function", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L110-L117
4,910
angular/material
src/components/tabs/js/tabsController.js
defineOneWayBinding
function defineOneWayBinding (key, handler) { var attr = $attrs.$normalize('md-' + key); if (handler) defineProperty(key, handler); $attrs.$observe(attr, function (newValue) { ctrl[ key ] = newValue; }); }
javascript
function defineOneWayBinding (key, handler) { var attr = $attrs.$normalize('md-' + key); if (handler) defineProperty(key, handler); $attrs.$observe(attr, function (newValue) { ctrl[ key ] = newValue; }); }
[ "function", "defineOneWayBinding", "(", "key", ",", "handler", ")", "{", "var", "attr", "=", "$attrs", ".", "$normalize", "(", "'md-'", "+", "key", ")", ";", "if", "(", "handler", ")", "defineProperty", "(", "key", ",", "handler", ")", ";", "$attrs", "...
Creates a one-way binding manually rather than relying on AngularJS's isolated scope @param key @param handler
[ "Creates", "a", "one", "-", "way", "binding", "manually", "rather", "than", "relying", "on", "AngularJS", "s", "isolated", "scope" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L139-L143
4,911
angular/material
src/components/tabs/js/tabsController.js
defineBooleanAttribute
function defineBooleanAttribute (key, handler) { var attr = $attrs.$normalize('md-' + key); if (handler) defineProperty(key, handler); if ($attrs.hasOwnProperty(attr)) updateValue($attrs[attr]); $attrs.$observe(attr, updateValue); function updateValue (newValue) { ctrl[ key ] = newValue !== 'f...
javascript
function defineBooleanAttribute (key, handler) { var attr = $attrs.$normalize('md-' + key); if (handler) defineProperty(key, handler); if ($attrs.hasOwnProperty(attr)) updateValue($attrs[attr]); $attrs.$observe(attr, updateValue); function updateValue (newValue) { ctrl[ key ] = newValue !== 'f...
[ "function", "defineBooleanAttribute", "(", "key", ",", "handler", ")", "{", "var", "attr", "=", "$attrs", ".", "$normalize", "(", "'md-'", "+", "key", ")", ";", "if", "(", "handler", ")", "defineProperty", "(", "key", ",", "handler", ")", ";", "if", "(...
Defines boolean attributes with default value set to true. I.e. md-stretch-tabs with no value will be treated as being truthy. @param {string} key @param {Function} handler
[ "Defines", "boolean", "attributes", "with", "default", "value", "set", "to", "true", ".", "I", ".", "e", ".", "md", "-", "stretch", "-", "tabs", "with", "no", "value", "will", "be", "treated", "as", "being", "truthy", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L151-L159
4,912
angular/material
src/components/tabs/js/tabsController.js
handleFocusIndexChange
function handleFocusIndexChange (newIndex, oldIndex) { if (newIndex === oldIndex) return; if (!getElements().tabs[ newIndex ]) return; adjustOffset(); redirectFocus(); }
javascript
function handleFocusIndexChange (newIndex, oldIndex) { if (newIndex === oldIndex) return; if (!getElements().tabs[ newIndex ]) return; adjustOffset(); redirectFocus(); }
[ "function", "handleFocusIndexChange", "(", "newIndex", ",", "oldIndex", ")", "{", "if", "(", "newIndex", "===", "oldIndex", ")", "return", ";", "if", "(", "!", "getElements", "(", ")", ".", "tabs", "[", "newIndex", "]", ")", "return", ";", "adjustOffset", ...
Update the UI whenever `ctrl.focusIndex` is updated @param {number} newIndex @param {number} oldIndex
[ "Update", "the", "UI", "whenever", "ctrl", ".", "focusIndex", "is", "updated" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L248-L253
4,913
angular/material
src/components/tabs/js/tabsController.js
handleResizeWhenVisible
function handleResizeWhenVisible () { // if there is already a watcher waiting for resize, do nothing if (handleResizeWhenVisible.watcher) return; // otherwise, we will abuse the $watch function to check for visible handleResizeWhenVisible.watcher = $scope.$watch(function () { // since we are chec...
javascript
function handleResizeWhenVisible () { // if there is already a watcher waiting for resize, do nothing if (handleResizeWhenVisible.watcher) return; // otherwise, we will abuse the $watch function to check for visible handleResizeWhenVisible.watcher = $scope.$watch(function () { // since we are chec...
[ "function", "handleResizeWhenVisible", "(", ")", "{", "// if there is already a watcher waiting for resize, do nothing", "if", "(", "handleResizeWhenVisible", ".", "watcher", ")", "return", ";", "// otherwise, we will abuse the $watch function to check for visible", "handleResizeWhenVi...
Queues up a call to `handleWindowResize` when a resize occurs while the tabs component is hidden.
[ "Queues", "up", "a", "call", "to", "handleWindowResize", "when", "a", "resize", "occurs", "while", "the", "tabs", "component", "is", "hidden", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L282-L300
4,914
angular/material
src/components/tabs/js/tabsController.js
select
function select (index, canSkipClick) { if (!locked) ctrl.focusIndex = ctrl.selectedIndex = index; // skip the click event if noSelectClick is enabled if (canSkipClick && ctrl.noSelectClick) return; // nextTick is required to prevent errors in user-defined click events $mdUtil.nextTick(function () {...
javascript
function select (index, canSkipClick) { if (!locked) ctrl.focusIndex = ctrl.selectedIndex = index; // skip the click event if noSelectClick is enabled if (canSkipClick && ctrl.noSelectClick) return; // nextTick is required to prevent errors in user-defined click events $mdUtil.nextTick(function () {...
[ "function", "select", "(", "index", ",", "canSkipClick", ")", "{", "if", "(", "!", "locked", ")", "ctrl", ".", "focusIndex", "=", "ctrl", ".", "selectedIndex", "=", "index", ";", "// skip the click event if noSelectClick is enabled", "if", "(", "canSkipClick", "...
Update the selected index. Triggers a click event on the original `md-tab` element in order to fire user-added click events if canSkipClick or `md-no-select-click` are false. @param index @param canSkipClick Optionally allow not firing the click event if `md-no-select-click` is also true.
[ "Update", "the", "selected", "index", ".", "Triggers", "a", "click", "event", "on", "the", "original", "md", "-", "tab", "element", "in", "order", "to", "fire", "user", "-", "added", "click", "events", "if", "canSkipClick", "or", "md", "-", "no", "-", ...
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L339-L347
4,915
angular/material
src/components/tabs/js/tabsController.js
scroll
function scroll (event) { if (!ctrl.shouldPaginate) return; event.preventDefault(); if (event.deltaY) { ctrl.offsetLeft = fixOffset(ctrl.offsetLeft + event.deltaY); } else if (event.deltaX) { ctrl.offsetLeft = fixOffset(ctrl.offsetLeft + event.deltaX); } }
javascript
function scroll (event) { if (!ctrl.shouldPaginate) return; event.preventDefault(); if (event.deltaY) { ctrl.offsetLeft = fixOffset(ctrl.offsetLeft + event.deltaY); } else if (event.deltaX) { ctrl.offsetLeft = fixOffset(ctrl.offsetLeft + event.deltaX); } }
[ "function", "scroll", "(", "event", ")", "{", "if", "(", "!", "ctrl", ".", "shouldPaginate", ")", "return", ";", "event", ".", "preventDefault", "(", ")", ";", "if", "(", "event", ".", "deltaY", ")", "{", "ctrl", ".", "offsetLeft", "=", "fixOffset", ...
When pagination is on, this makes sure the selected index is in view. @param {WheelEvent} event
[ "When", "pagination", "is", "on", "this", "makes", "sure", "the", "selected", "index", "is", "in", "view", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L353-L361
4,916
angular/material
src/components/tabs/js/tabsController.js
nextPage
function nextPage () { if (!ctrl.canPageForward()) { return; } var newOffset = MdTabsPaginationService.increasePageOffset(getElements(), ctrl.offsetLeft); ctrl.offsetLeft = fixOffset(newOffset); }
javascript
function nextPage () { if (!ctrl.canPageForward()) { return; } var newOffset = MdTabsPaginationService.increasePageOffset(getElements(), ctrl.offsetLeft); ctrl.offsetLeft = fixOffset(newOffset); }
[ "function", "nextPage", "(", ")", "{", "if", "(", "!", "ctrl", ".", "canPageForward", "(", ")", ")", "{", "return", ";", "}", "var", "newOffset", "=", "MdTabsPaginationService", ".", "increasePageOffset", "(", "getElements", "(", ")", ",", "ctrl", ".", "...
Slides the tabs over approximately one page forward.
[ "Slides", "the", "tabs", "over", "approximately", "one", "page", "forward", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L366-L372
4,917
angular/material
src/components/tabs/js/tabsController.js
previousPage
function previousPage () { if (!ctrl.canPageBack()) { return; } var newOffset = MdTabsPaginationService.decreasePageOffset(getElements(), ctrl.offsetLeft); // Set the new offset ctrl.offsetLeft = fixOffset(newOffset); }
javascript
function previousPage () { if (!ctrl.canPageBack()) { return; } var newOffset = MdTabsPaginationService.decreasePageOffset(getElements(), ctrl.offsetLeft); // Set the new offset ctrl.offsetLeft = fixOffset(newOffset); }
[ "function", "previousPage", "(", ")", "{", "if", "(", "!", "ctrl", ".", "canPageBack", "(", ")", ")", "{", "return", ";", "}", "var", "newOffset", "=", "MdTabsPaginationService", ".", "decreasePageOffset", "(", "getElements", "(", ")", ",", "ctrl", ".", ...
Slides the tabs over approximately one page backward.
[ "Slides", "the", "tabs", "over", "approximately", "one", "page", "backward", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L377-L384
4,918
angular/material
src/components/tabs/js/tabsController.js
handleWindowResize
function handleWindowResize () { ctrl.lastSelectedIndex = ctrl.selectedIndex; ctrl.offsetLeft = fixOffset(ctrl.offsetLeft); $mdUtil.nextTick(function () { ctrl.updateInkBarStyles(); updatePagination(); }); }
javascript
function handleWindowResize () { ctrl.lastSelectedIndex = ctrl.selectedIndex; ctrl.offsetLeft = fixOffset(ctrl.offsetLeft); $mdUtil.nextTick(function () { ctrl.updateInkBarStyles(); updatePagination(); }); }
[ "function", "handleWindowResize", "(", ")", "{", "ctrl", ".", "lastSelectedIndex", "=", "ctrl", ".", "selectedIndex", ";", "ctrl", ".", "offsetLeft", "=", "fixOffset", "(", "ctrl", ".", "offsetLeft", ")", ";", "$mdUtil", ".", "nextTick", "(", "function", "("...
Update size calculations when the window is resized.
[ "Update", "size", "calculations", "when", "the", "window", "is", "resized", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L389-L397
4,919
angular/material
src/components/tabs/js/tabsController.js
removeTab
function removeTab (tabData) { if (destroyed) return; var selectedIndex = ctrl.selectedIndex, tab = ctrl.tabs.splice(tabData.getIndex(), 1)[ 0 ]; refreshIndex(); // when removing a tab, if the selected index did not change, we have to manually trigger the // tab select/deselect e...
javascript
function removeTab (tabData) { if (destroyed) return; var selectedIndex = ctrl.selectedIndex, tab = ctrl.tabs.splice(tabData.getIndex(), 1)[ 0 ]; refreshIndex(); // when removing a tab, if the selected index did not change, we have to manually trigger the // tab select/deselect e...
[ "function", "removeTab", "(", "tabData", ")", "{", "if", "(", "destroyed", ")", "return", ";", "var", "selectedIndex", "=", "ctrl", ".", "selectedIndex", ",", "tab", "=", "ctrl", ".", "tabs", ".", "splice", "(", "tabData", ".", "getIndex", "(", ")", ",...
Remove a tab from the data and select the nearest valid tab. @param {Object} tabData tab to remove
[ "Remove", "a", "tab", "from", "the", "data", "and", "select", "the", "nearest", "valid", "tab", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L421-L436
4,920
angular/material
src/components/tabs/js/tabsController.js
insertTab
function insertTab (tabData, index) { var hasLoaded = loaded; var proto = { getIndex: function () { return ctrl.tabs.indexOf(tab); }, isActive: function () { return this.getIndex() === ctrl.selectedIndex; }, isLeft: function () { return this.getIndex() < ctrl.selected...
javascript
function insertTab (tabData, index) { var hasLoaded = loaded; var proto = { getIndex: function () { return ctrl.tabs.indexOf(tab); }, isActive: function () { return this.getIndex() === ctrl.selectedIndex; }, isLeft: function () { return this.getIndex() < ctrl.selected...
[ "function", "insertTab", "(", "tabData", ",", "index", ")", "{", "var", "hasLoaded", "=", "loaded", ";", "var", "proto", "=", "{", "getIndex", ":", "function", "(", ")", "{", "return", "ctrl", ".", "tabs", ".", "indexOf", "(", "tab", ")", ";", "}", ...
Create an entry in the tabs array for a new tab at the specified index. @param {Object} tabData tab to insert @param {number} index location to insert the new tab @returns {Object} the inserted tab
[ "Create", "an", "entry", "in", "the", "tabs", "array", "for", "a", "new", "tab", "at", "the", "specified", "index", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L444-L481
4,921
angular/material
src/components/tabs/js/tabsController.js
getElements
function getElements () { var elements = {}; var node = $element[0]; // gather tab bar elements elements.wrapper = node.querySelector('md-tabs-wrapper'); elements.canvas = elements.wrapper.querySelector('md-tabs-canvas'); elements.paging = elements.canvas.querySelector('md-pagination-wrapper'...
javascript
function getElements () { var elements = {}; var node = $element[0]; // gather tab bar elements elements.wrapper = node.querySelector('md-tabs-wrapper'); elements.canvas = elements.wrapper.querySelector('md-tabs-canvas'); elements.paging = elements.canvas.querySelector('md-pagination-wrapper'...
[ "function", "getElements", "(", ")", "{", "var", "elements", "=", "{", "}", ";", "var", "node", "=", "$element", "[", "0", "]", ";", "// gather tab bar elements", "elements", ".", "wrapper", "=", "node", ".", "querySelector", "(", "'md-tabs-wrapper'", ")", ...
Getter methods Gathers references to all of the DOM elements used by this controller. @returns {Object}
[ "Getter", "methods", "Gathers", "references", "to", "all", "of", "the", "DOM", "elements", "used", "by", "this", "controller", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L489-L506
4,922
angular/material
src/components/tabs/js/tabsController.js
canPageForward
function canPageForward () { var elements = getElements(); var lastTab = elements.tabs[ elements.tabs.length - 1 ]; if (isRtl()) { return ctrl.offsetLeft < elements.paging.offsetWidth - elements.canvas.offsetWidth; } return lastTab && lastTab.offsetLeft + lastTab.offsetWidth > elements.canva...
javascript
function canPageForward () { var elements = getElements(); var lastTab = elements.tabs[ elements.tabs.length - 1 ]; if (isRtl()) { return ctrl.offsetLeft < elements.paging.offsetWidth - elements.canvas.offsetWidth; } return lastTab && lastTab.offsetLeft + lastTab.offsetWidth > elements.canva...
[ "function", "canPageForward", "(", ")", "{", "var", "elements", "=", "getElements", "(", ")", ";", "var", "lastTab", "=", "elements", ".", "tabs", "[", "elements", ".", "tabs", ".", "length", "-", "1", "]", ";", "if", "(", "isRtl", "(", ")", ")", "...
Determines whether or not the right pagination arrow should be enabled. @returns {*|boolean}
[ "Determines", "whether", "or", "not", "the", "right", "pagination", "arrow", "should", "be", "enabled", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L521-L531
4,923
angular/material
src/components/tabs/js/tabsController.js
getFocusedTabId
function getFocusedTabId() { var focusedTab = ctrl.tabs[ctrl.focusIndex]; if (!focusedTab || !focusedTab.id) { return null; } return 'tab-item-' + focusedTab.id; }
javascript
function getFocusedTabId() { var focusedTab = ctrl.tabs[ctrl.focusIndex]; if (!focusedTab || !focusedTab.id) { return null; } return 'tab-item-' + focusedTab.id; }
[ "function", "getFocusedTabId", "(", ")", "{", "var", "focusedTab", "=", "ctrl", ".", "tabs", "[", "ctrl", ".", "focusIndex", "]", ";", "if", "(", "!", "focusedTab", "||", "!", "focusedTab", ".", "id", ")", "{", "return", "null", ";", "}", "return", "...
Returns currently focused tab item's element ID
[ "Returns", "currently", "focused", "tab", "item", "s", "element", "ID" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L536-L542
4,924
angular/material
src/components/tabs/js/tabsController.js
shouldPaginate
function shouldPaginate () { var shouldPaginate; if (ctrl.noPagination || !loaded) return false; var canvasWidth = $element.prop('clientWidth'); angular.forEach(getElements().tabs, function (tab) { canvasWidth -= tab.offsetWidth; }); shouldPaginate = canvasWidth < 0; // Work around w...
javascript
function shouldPaginate () { var shouldPaginate; if (ctrl.noPagination || !loaded) return false; var canvasWidth = $element.prop('clientWidth'); angular.forEach(getElements().tabs, function (tab) { canvasWidth -= tab.offsetWidth; }); shouldPaginate = canvasWidth < 0; // Work around w...
[ "function", "shouldPaginate", "(", ")", "{", "var", "shouldPaginate", ";", "if", "(", "ctrl", ".", "noPagination", "||", "!", "loaded", ")", "return", "false", ";", "var", "canvasWidth", "=", "$element", ".", "prop", "(", "'clientWidth'", ")", ";", "angula...
Determines if pagination is necessary to display the tabs within the available space. @returns {boolean} true if pagination is necessary, false otherwise
[ "Determines", "if", "pagination", "is", "necessary", "to", "display", "the", "tabs", "within", "the", "available", "space", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L572-L592
4,925
angular/material
src/components/tabs/js/tabsController.js
getNearestSafeIndex
function getNearestSafeIndex (newIndex) { if (newIndex === -1) return -1; var maxOffset = Math.max(ctrl.tabs.length - newIndex, newIndex), i, tab; for (i = 0; i <= maxOffset; i++) { tab = ctrl.tabs[ newIndex + i ]; if (tab && (tab.scope.disabled !== true)) return tab.getIndex(); ta...
javascript
function getNearestSafeIndex (newIndex) { if (newIndex === -1) return -1; var maxOffset = Math.max(ctrl.tabs.length - newIndex, newIndex), i, tab; for (i = 0; i <= maxOffset; i++) { tab = ctrl.tabs[ newIndex + i ]; if (tab && (tab.scope.disabled !== true)) return tab.getIndex(); ta...
[ "function", "getNearestSafeIndex", "(", "newIndex", ")", "{", "if", "(", "newIndex", "===", "-", "1", ")", "return", "-", "1", ";", "var", "maxOffset", "=", "Math", ".", "max", "(", "ctrl", ".", "tabs", ".", "length", "-", "newIndex", ",", "newIndex", ...
Finds the nearest tab index that is available. This is primarily used for when the active tab is removed. @param newIndex @returns {*}
[ "Finds", "the", "nearest", "tab", "index", "that", "is", "available", ".", "This", "is", "primarily", "used", "for", "when", "the", "active", "tab", "is", "removed", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L600-L611
4,926
angular/material
src/components/tabs/js/tabsController.js
updateTabOrder
function updateTabOrder () { var selectedItem = ctrl.tabs[ ctrl.selectedIndex ], focusItem = ctrl.tabs[ ctrl.focusIndex ]; ctrl.tabs = ctrl.tabs.sort(function (a, b) { return a.index - b.index; }); ctrl.selectedIndex = ctrl.tabs.indexOf(selectedItem); ctrl.focusIndex ...
javascript
function updateTabOrder () { var selectedItem = ctrl.tabs[ ctrl.selectedIndex ], focusItem = ctrl.tabs[ ctrl.focusIndex ]; ctrl.tabs = ctrl.tabs.sort(function (a, b) { return a.index - b.index; }); ctrl.selectedIndex = ctrl.tabs.indexOf(selectedItem); ctrl.focusIndex ...
[ "function", "updateTabOrder", "(", ")", "{", "var", "selectedItem", "=", "ctrl", ".", "tabs", "[", "ctrl", ".", "selectedIndex", "]", ",", "focusItem", "=", "ctrl", ".", "tabs", "[", "ctrl", ".", "focusIndex", "]", ";", "ctrl", ".", "tabs", "=", "ctrl"...
Re-orders the tabs and updates the selected and focus indexes to their new positions. This is triggered by `tabDirective.js` when the user's tabs have been re-ordered.
[ "Re", "-", "orders", "the", "tabs", "and", "updates", "the", "selected", "and", "focus", "indexes", "to", "their", "new", "positions", ".", "This", "is", "triggered", "by", "tabDirective", ".", "js", "when", "the", "user", "s", "tabs", "have", "been", "r...
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L679-L687
4,927
angular/material
src/components/tabs/js/tabsController.js
incrementIndex
function incrementIndex (inc, focus) { var newIndex, key = focus ? 'focusIndex' : 'selectedIndex', index = ctrl[ key ]; for (newIndex = index + inc; ctrl.tabs[ newIndex ] && ctrl.tabs[ newIndex ].scope.disabled; newIndex += inc) { /* do nothing */ } newIndex = (index + i...
javascript
function incrementIndex (inc, focus) { var newIndex, key = focus ? 'focusIndex' : 'selectedIndex', index = ctrl[ key ]; for (newIndex = index + inc; ctrl.tabs[ newIndex ] && ctrl.tabs[ newIndex ].scope.disabled; newIndex += inc) { /* do nothing */ } newIndex = (index + i...
[ "function", "incrementIndex", "(", "inc", ",", "focus", ")", "{", "var", "newIndex", ",", "key", "=", "focus", "?", "'focusIndex'", ":", "'selectedIndex'", ",", "index", "=", "ctrl", "[", "key", "]", ";", "for", "(", "newIndex", "=", "index", "+", "inc...
This moves the selected or focus index left or right. This is used by the keydown handler. @param {number} inc amount to increment @param {boolean} focus true to increment the focus index, false to increment the selected index
[ "This", "moves", "the", "selected", "or", "focus", "index", "left", "or", "right", ".", "This", "is", "used", "by", "the", "keydown", "handler", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L694-L707
4,928
angular/material
src/components/tabs/js/tabsController.js
redirectFocus
function redirectFocus () { ctrl.styleTabItemFocus = ($mdInteraction.getLastInteractionType() === 'keyboard'); var tabToFocus = getElements().tabs[ctrl.focusIndex]; if (tabToFocus) { tabToFocus.focus(); } }
javascript
function redirectFocus () { ctrl.styleTabItemFocus = ($mdInteraction.getLastInteractionType() === 'keyboard'); var tabToFocus = getElements().tabs[ctrl.focusIndex]; if (tabToFocus) { tabToFocus.focus(); } }
[ "function", "redirectFocus", "(", ")", "{", "ctrl", ".", "styleTabItemFocus", "=", "(", "$mdInteraction", ".", "getLastInteractionType", "(", ")", "===", "'keyboard'", ")", ";", "var", "tabToFocus", "=", "getElements", "(", ")", ".", "tabs", "[", "ctrl", "."...
This is used to forward focus to tab container elements. This method is necessary to avoid animation issues when attempting to focus an item that is out of view.
[ "This", "is", "used", "to", "forward", "focus", "to", "tab", "container", "elements", ".", "This", "method", "is", "necessary", "to", "avoid", "animation", "issues", "when", "attempting", "to", "focus", "an", "item", "that", "is", "out", "of", "view", "." ...
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L713-L719
4,929
angular/material
src/components/tabs/js/tabsController.js
updateHasContent
function updateHasContent () { var hasContent = false; var i; for (i = 0; i < ctrl.tabs.length; i++) { if (ctrl.tabs[i].hasContent) { hasContent = true; break; } } ctrl.hasContent = hasContent; }
javascript
function updateHasContent () { var hasContent = false; var i; for (i = 0; i < ctrl.tabs.length; i++) { if (ctrl.tabs[i].hasContent) { hasContent = true; break; } } ctrl.hasContent = hasContent; }
[ "function", "updateHasContent", "(", ")", "{", "var", "hasContent", "=", "false", ";", "var", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "ctrl", ".", "tabs", ".", "length", ";", "i", "++", ")", "{", "if", "(", "ctrl", ".", "tabs", "[",...
Determines if the tab content area is needed.
[ "Determines", "if", "the", "tab", "content", "area", "is", "needed", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L766-L778
4,930
angular/material
src/components/tabs/js/tabsController.js
refreshIndex
function refreshIndex () { ctrl.selectedIndex = getNearestSafeIndex(ctrl.selectedIndex); ctrl.focusIndex = getNearestSafeIndex(ctrl.focusIndex); }
javascript
function refreshIndex () { ctrl.selectedIndex = getNearestSafeIndex(ctrl.selectedIndex); ctrl.focusIndex = getNearestSafeIndex(ctrl.focusIndex); }
[ "function", "refreshIndex", "(", ")", "{", "ctrl", ".", "selectedIndex", "=", "getNearestSafeIndex", "(", "ctrl", ".", "selectedIndex", ")", ";", "ctrl", ".", "focusIndex", "=", "getNearestSafeIndex", "(", "ctrl", ".", "focusIndex", ")", ";", "}" ]
Moves the indexes to their nearest valid values.
[ "Moves", "the", "indexes", "to", "their", "nearest", "valid", "values", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L783-L786
4,931
angular/material
src/components/tabs/js/tabsController.js
updateHeightFromContent
function updateHeightFromContent () { if (!ctrl.dynamicHeight) return $element.css('height', ''); if (!ctrl.tabs.length) return queue.push(updateHeightFromContent); var elements = getElements(); var tabContent = elements.contents[ ctrl.selectedIndex ], contentHeight = tabContent ? tabConten...
javascript
function updateHeightFromContent () { if (!ctrl.dynamicHeight) return $element.css('height', ''); if (!ctrl.tabs.length) return queue.push(updateHeightFromContent); var elements = getElements(); var tabContent = elements.contents[ ctrl.selectedIndex ], contentHeight = tabContent ? tabConten...
[ "function", "updateHeightFromContent", "(", ")", "{", "if", "(", "!", "ctrl", ".", "dynamicHeight", ")", "return", "$element", ".", "css", "(", "'height'", ",", "''", ")", ";", "if", "(", "!", "ctrl", ".", "tabs", ".", "length", ")", "return", "queue",...
Calculates the content height of the current tab. @returns {*}
[ "Calculates", "the", "content", "height", "of", "the", "current", "tab", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L792-L851
4,932
angular/material
src/components/tabs/js/tabsController.js
updateInkBarStyles
function updateInkBarStyles (previousTotalWidth, previousWidthOfTabItems) { if (ctrl.noInkBar) { return; } var elements = getElements(); if (!elements.tabs[ ctrl.selectedIndex ]) { angular.element(elements.inkBar).css({ left: 'auto', right: 'auto' }); return; } if (!ctrl.tabs...
javascript
function updateInkBarStyles (previousTotalWidth, previousWidthOfTabItems) { if (ctrl.noInkBar) { return; } var elements = getElements(); if (!elements.tabs[ ctrl.selectedIndex ]) { angular.element(elements.inkBar).css({ left: 'auto', right: 'auto' }); return; } if (!ctrl.tabs...
[ "function", "updateInkBarStyles", "(", "previousTotalWidth", ",", "previousWidthOfTabItems", ")", "{", "if", "(", "ctrl", ".", "noInkBar", ")", "{", "return", ";", "}", "var", "elements", "=", "getElements", "(", ")", ";", "if", "(", "!", "elements", ".", ...
Repositions the ink bar to the selected tab. Parameters are used when calling itself recursively when md-center-tabs is used as we need to run two passes to properly center the tabs. These parameters ensure that we only run two passes and that we don't run indefinitely. @param {number=} previousTotalWidth previous widt...
[ "Repositions", "the", "ink", "bar", "to", "the", "selected", "tab", ".", "Parameters", "are", "used", "when", "calling", "itself", "recursively", "when", "md", "-", "center", "-", "tabs", "is", "used", "as", "we", "need", "to", "run", "two", "passes", "t...
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L861-L902
4,933
angular/material
src/components/tabs/js/tabsController.js
attachRipple
function attachRipple (scope, element) { var elements = getElements(); var options = { colorElement: angular.element(elements.inkBar) }; $mdTabInkRipple.attach(scope, element, options); }
javascript
function attachRipple (scope, element) { var elements = getElements(); var options = { colorElement: angular.element(elements.inkBar) }; $mdTabInkRipple.attach(scope, element, options); }
[ "function", "attachRipple", "(", "scope", ",", "element", ")", "{", "var", "elements", "=", "getElements", "(", ")", ";", "var", "options", "=", "{", "colorElement", ":", "angular", ".", "element", "(", "elements", ".", "inkBar", ")", "}", ";", "$mdTabIn...
Attaches a ripple to the tab item element. @param scope @param element
[ "Attaches", "a", "ripple", "to", "the", "tab", "item", "element", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L947-L951
4,934
angular/material
src/components/tabs/js/tabsController.js
setAriaControls
function setAriaControls (tab) { if (tab.hasContent) { var nodes = $element[0].querySelectorAll('[md-tab-id="' + tab.id + '"]'); angular.element(nodes).attr('aria-controls', ctrl.tabContentPrefix + tab.id); } }
javascript
function setAriaControls (tab) { if (tab.hasContent) { var nodes = $element[0].querySelectorAll('[md-tab-id="' + tab.id + '"]'); angular.element(nodes).attr('aria-controls', ctrl.tabContentPrefix + tab.id); } }
[ "function", "setAriaControls", "(", "tab", ")", "{", "if", "(", "tab", ".", "hasContent", ")", "{", "var", "nodes", "=", "$element", "[", "0", "]", ".", "querySelectorAll", "(", "'[md-tab-id=\"'", "+", "tab", ".", "id", "+", "'\"]'", ")", ";", "angular...
Sets the `aria-controls` attribute to the elements that correspond to the passed-in tab. @param tab
[ "Sets", "the", "aria", "-", "controls", "attribute", "to", "the", "elements", "that", "correspond", "to", "the", "passed", "-", "in", "tab", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L957-L962
4,935
angular/material
src/components/list/list.js
copyAttributes
function copyAttributes(source, destination, extraAttrs) { var copiedAttrs = $mdUtil.prefixer([ 'ng-if', 'ng-click', 'ng-dblclick', 'aria-label', 'ng-disabled', 'ui-sref', 'href', 'ng-href', 'rel', 'target', 'ng-attr-ui-sref', 'ui-sref-opts', 'download' ]); if (extraAttrs) {...
javascript
function copyAttributes(source, destination, extraAttrs) { var copiedAttrs = $mdUtil.prefixer([ 'ng-if', 'ng-click', 'ng-dblclick', 'aria-label', 'ng-disabled', 'ui-sref', 'href', 'ng-href', 'rel', 'target', 'ng-attr-ui-sref', 'ui-sref-opts', 'download' ]); if (extraAttrs) {...
[ "function", "copyAttributes", "(", "source", ",", "destination", ",", "extraAttrs", ")", "{", "var", "copiedAttrs", "=", "$mdUtil", ".", "prefixer", "(", "[", "'ng-if'", ",", "'ng-click'", ",", "'ng-dblclick'", ",", "'aria-label'", ",", "'ng-disabled'", ",", "...
Copies attributes from a source element to the destination element By default the function will copy the most necessary attributes, supported by the button executor for clickable list items. @param source Element with the specified attributes @param destination Element which will retrieve the attributes @param extraAtt...
[ "Copies", "attributes", "from", "a", "source", "element", "to", "the", "destination", "element", "By", "default", "the", "function", "will", "copy", "the", "most", "necessary", "attributes", "supported", "by", "the", "button", "executor", "for", "clickable", "li...
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/list/list.js#L406-L422
4,936
angular/material
src/core/services/ripple/ripple.js
InkRippleCtrl
function InkRippleCtrl ($scope, $element, rippleOptions, $window, $timeout, $mdUtil, $mdColorUtil) { this.$window = $window; this.$timeout = $timeout; this.$mdUtil = $mdUtil; this.$mdColorUtil = $mdColorUtil; this.$scope = $scope; this.$element = $element; this.options = rippleOptions;...
javascript
function InkRippleCtrl ($scope, $element, rippleOptions, $window, $timeout, $mdUtil, $mdColorUtil) { this.$window = $window; this.$timeout = $timeout; this.$mdUtil = $mdUtil; this.$mdColorUtil = $mdColorUtil; this.$scope = $scope; this.$element = $element; this.options = rippleOptions;...
[ "function", "InkRippleCtrl", "(", "$scope", ",", "$element", ",", "rippleOptions", ",", "$window", ",", "$timeout", ",", "$mdUtil", ",", "$mdColorUtil", ")", "{", "this", ".", "$window", "=", "$window", ";", "this", ".", "$timeout", "=", "$timeout", ";", "...
Controller used by the ripple service in order to apply ripples @ngInject
[ "Controller", "used", "by", "the", "ripple", "service", "in", "order", "to", "apply", "ripples" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/ripple/ripple.js#L158-L180
4,937
angular/material
src/core/services/ripple/ripple.js
getElementColor
function getElementColor () { var items = self.options && self.options.colorElement ? self.options.colorElement : []; var elem = items.length ? items[ 0 ] : self.$element[ 0 ]; return elem ? self.$window.getComputedStyle(elem).color : 'rgb(0,0,0)'; }
javascript
function getElementColor () { var items = self.options && self.options.colorElement ? self.options.colorElement : []; var elem = items.length ? items[ 0 ] : self.$element[ 0 ]; return elem ? self.$window.getComputedStyle(elem).color : 'rgb(0,0,0)'; }
[ "function", "getElementColor", "(", ")", "{", "var", "items", "=", "self", ".", "options", "&&", "self", ".", "options", ".", "colorElement", "?", "self", ".", "options", ".", "colorElement", ":", "[", "]", ";", "var", "elem", "=", "items", ".", "lengt...
Finds the color element and returns its text color for use as default ripple color @returns {string}
[ "Finds", "the", "color", "element", "and", "returns", "its", "text", "color", "for", "use", "as", "default", "ripple", "color" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/ripple/ripple.js#L214-L219
4,938
angular/material
src/components/datepicker/js/dateLocaleProvider.js
defaultFormatDate
function defaultFormatDate(date, timezone) { if (!date) { return ''; } // All of the dates created through ng-material *should* be set to midnight. // If we encounter a date where the localeTime shows at 11pm instead of midnight, // we have run into an issue with DST w...
javascript
function defaultFormatDate(date, timezone) { if (!date) { return ''; } // All of the dates created through ng-material *should* be set to midnight. // If we encounter a date where the localeTime shows at 11pm instead of midnight, // we have run into an issue with DST w...
[ "function", "defaultFormatDate", "(", "date", ",", "timezone", ")", "{", "if", "(", "!", "date", ")", "{", "return", "''", ";", "}", "// All of the dates created through ng-material *should* be set to midnight.", "// If we encounter a date where the localeTime shows at 11pm ins...
Default date-to-string formatting function. @param {!Date} date @param {string=} timezone @returns {string}
[ "Default", "date", "-", "to", "-", "string", "formatting", "function", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/dateLocaleProvider.js#L195-L213
4,939
angular/material
src/components/datepicker/js/dateLocaleProvider.js
defaultLongDateFormatter
function defaultLongDateFormatter(date) { // Example: 'Thursday June 18 2015' return [ service.days[date.getDay()], service.months[date.getMonth()], service.dates[date.getDate()], date.getFullYear() ].join(' '); }
javascript
function defaultLongDateFormatter(date) { // Example: 'Thursday June 18 2015' return [ service.days[date.getDay()], service.months[date.getMonth()], service.dates[date.getDate()], date.getFullYear() ].join(' '); }
[ "function", "defaultLongDateFormatter", "(", "date", ")", "{", "// Example: 'Thursday June 18 2015'", "return", "[", "service", ".", "days", "[", "date", ".", "getDay", "(", ")", "]", ",", "service", ".", "months", "[", "date", ".", "getMonth", "(", ")", "]"...
Default formatter for date cell aria-labels. @param {!Date} date @returns {string}
[ "Default", "formatter", "for", "date", "cell", "aria", "-", "labels", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/dateLocaleProvider.js#L274-L282
4,940
angular/material
src/components/datepicker/js/calendarMonth.js
calendarDirective
function calendarDirective() { return { template: '<table aria-hidden="true" class="md-calendar-day-header"><thead></thead></table>' + '<div class="md-calendar-scroll-mask">' + '<md-virtual-repeat-container class="md-calendar-scroll-container" ' + 'md-offset-size="' + (TB...
javascript
function calendarDirective() { return { template: '<table aria-hidden="true" class="md-calendar-day-header"><thead></thead></table>' + '<div class="md-calendar-scroll-mask">' + '<md-virtual-repeat-container class="md-calendar-scroll-container" ' + 'md-offset-size="' + (TB...
[ "function", "calendarDirective", "(", ")", "{", "return", "{", "template", ":", "'<table aria-hidden=\"true\" class=\"md-calendar-day-header\"><thead></thead></table>'", "+", "'<div class=\"md-calendar-scroll-mask\">'", "+", "'<md-virtual-repeat-container class=\"md-calendar-scroll-contain...
Private directive that represents a list of months inside the calendar.
[ "Private", "directive", "that", "represents", "a", "list", "of", "months", "inside", "the", "calendar", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/calendarMonth.js#L20-L55
4,941
angular/material
src/components/datepicker/js/calendarMonth.js
CalendarMonthCtrl
function CalendarMonthCtrl($element, $scope, $animate, $q, $$mdDateUtil, $mdDateLocale) { /** @final {!angular.JQLite} */ this.$element = $element; /** @final {!angular.Scope} */ this.$scope = $scope; /** @final {!angular.$animate} */ this.$animate = $animate; /** @final {!angular.$q...
javascript
function CalendarMonthCtrl($element, $scope, $animate, $q, $$mdDateUtil, $mdDateLocale) { /** @final {!angular.JQLite} */ this.$element = $element; /** @final {!angular.Scope} */ this.$scope = $scope; /** @final {!angular.$animate} */ this.$animate = $animate; /** @final {!angular.$q...
[ "function", "CalendarMonthCtrl", "(", "$element", ",", "$scope", ",", "$animate", ",", "$q", ",", "$$mdDateUtil", ",", "$mdDateLocale", ")", "{", "/** @final {!angular.JQLite} */", "this", ".", "$element", "=", "$element", ";", "/** @final {!angular.Scope} */", "this"...
Controller for the calendar month component. @ngInject @constructor
[ "Controller", "for", "the", "calendar", "month", "component", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/calendarMonth.js#L61-L113
4,942
angular/material
src/components/navBar/navBar.js
MdNavItemController
function MdNavItemController($element) { /** @private @const {!angular.JQLite} */ this._$element = $element; // Data-bound variables /** @const {?Function} */ this.mdNavClick; /** @const {?string} */ this.mdNavHref; /** @const {?string} */ this.mdNavSref; /** @const {?Object} */ this.srefOpts...
javascript
function MdNavItemController($element) { /** @private @const {!angular.JQLite} */ this._$element = $element; // Data-bound variables /** @const {?Function} */ this.mdNavClick; /** @const {?string} */ this.mdNavHref; /** @const {?string} */ this.mdNavSref; /** @const {?Object} */ this.srefOpts...
[ "function", "MdNavItemController", "(", "$element", ")", "{", "/** @private @const {!angular.JQLite} */", "this", ".", "_$element", "=", "$element", ";", "// Data-bound variables", "/** @const {?Function} */", "this", ".", "mdNavClick", ";", "/** @const {?string} */", "this",...
Controller for the nav-item component. @param {!angular.JQLite} $element @constructor @final @ngInject
[ "Controller", "for", "the", "nav", "-", "item", "component", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/navBar/navBar.js#L652-L681
4,943
angular/material
src/core/services/meta/meta.js
mapExistingElement
function mapExistingElement(name) { if (metaElements[name]) { return true; } var element = document.getElementsByName(name)[0]; if (!element) { return false; } metaElements[name] = angular.element(element); return true; }
javascript
function mapExistingElement(name) { if (metaElements[name]) { return true; } var element = document.getElementsByName(name)[0]; if (!element) { return false; } metaElements[name] = angular.element(element); return true; }
[ "function", "mapExistingElement", "(", "name", ")", "{", "if", "(", "metaElements", "[", "name", "]", ")", "{", "return", "true", ";", "}", "var", "element", "=", "document", ".", "getElementsByName", "(", "name", ")", "[", "0", "]", ";", "if", "(", ...
Checks if the requested element was written manually and maps it @param {string} name meta tag 'name' attribute value @returns {boolean} returns true if there is an element with the requested name
[ "Checks", "if", "the", "requested", "element", "was", "written", "manually", "and", "maps", "it" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/meta/meta.js#L44-L58
4,944
angular/material
src/components/chips/demoContactChips/script.js
delayedQuerySearch
function delayedQuerySearch(criteria) { if (!pendingSearch || !debounceSearch()) { cancelSearch(); return pendingSearch = $q(function(resolve, reject) { // Simulate async search... (after debouncing) cancelSearch = reject; $timeout(function() { resolve(...
javascript
function delayedQuerySearch(criteria) { if (!pendingSearch || !debounceSearch()) { cancelSearch(); return pendingSearch = $q(function(resolve, reject) { // Simulate async search... (after debouncing) cancelSearch = reject; $timeout(function() { resolve(...
[ "function", "delayedQuerySearch", "(", "criteria", ")", "{", "if", "(", "!", "pendingSearch", "||", "!", "debounceSearch", "(", ")", ")", "{", "cancelSearch", "(", ")", ";", "return", "pendingSearch", "=", "$q", "(", "function", "(", "resolve", ",", "rejec...
Async search for contacts Also debounce the queries; since the md-contact-chips does not support this
[ "Async", "search", "for", "contacts", "Also", "debounce", "the", "queries", ";", "since", "the", "md", "-", "contact", "-", "chips", "does", "not", "support", "this" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/chips/demoContactChips/script.js#L41-L58
4,945
angular/material
src/components/chips/js/contactChipsDirective.js
MdContactChips
function MdContactChips($mdTheming, $mdUtil) { return { template: function(element, attrs) { return MD_CONTACT_CHIPS_TEMPLATE; }, restrict: 'E', controller: 'MdContactChipsCtrl', controllerAs: '$mdContactChipsCtrl', bindToController: true, compile: compile, scope: { contact...
javascript
function MdContactChips($mdTheming, $mdUtil) { return { template: function(element, attrs) { return MD_CONTACT_CHIPS_TEMPLATE; }, restrict: 'E', controller: 'MdContactChipsCtrl', controllerAs: '$mdContactChipsCtrl', bindToController: true, compile: compile, scope: { contact...
[ "function", "MdContactChips", "(", "$mdTheming", ",", "$mdUtil", ")", "{", "return", "{", "template", ":", "function", "(", "element", ",", "attrs", ")", "{", "return", "MD_CONTACT_CHIPS_TEMPLATE", ";", "}", ",", "restrict", ":", "'E'", ",", "controller", ":...
MDContactChips Directive Definition @param $mdTheming @param $mdUtil @returns {*} @ngInject
[ "MDContactChips", "Directive", "Definition" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/chips/js/contactChipsDirective.js#L133-L181
4,946
angular/material
src/components/autocomplete/js/autocompleteDirective.js
getRepeatMode
function getRepeatMode(modeStr) { if (!modeStr) { return REPEAT_VIRTUAL; } modeStr = modeStr.toLowerCase(); return REPEAT_MODES.indexOf(modeStr) > -1 ? modeStr : REPEAT_VIRTUAL; }
javascript
function getRepeatMode(modeStr) { if (!modeStr) { return REPEAT_VIRTUAL; } modeStr = modeStr.toLowerCase(); return REPEAT_MODES.indexOf(modeStr) > -1 ? modeStr : REPEAT_VIRTUAL; }
[ "function", "getRepeatMode", "(", "modeStr", ")", "{", "if", "(", "!", "modeStr", ")", "{", "return", "REPEAT_VIRTUAL", ";", "}", "modeStr", "=", "modeStr", ".", "toLowerCase", "(", ")", ";", "return", "REPEAT_MODES", ".", "indexOf", "(", "modeStr", ")", ...
get a valid repeat mode from an md-mode attribute string.
[ "get", "a", "valid", "repeat", "mode", "from", "an", "md", "-", "mode", "attribute", "string", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/autocomplete/js/autocompleteDirective.js#L298-L302
4,947
angular/material
src/core/util/util.js
function (target, key, expectedVal) { var hasValue = false; if (target && target.length) { var computedStyles = $window.getComputedStyle(target[0]); hasValue = angular.isDefined(computedStyles[key]) && (expectedVal ? computedStyles[key] == expectedVal : true); } return hasValue; }
javascript
function (target, key, expectedVal) { var hasValue = false; if (target && target.length) { var computedStyles = $window.getComputedStyle(target[0]); hasValue = angular.isDefined(computedStyles[key]) && (expectedVal ? computedStyles[key] == expectedVal : true); } return hasValue; }
[ "function", "(", "target", ",", "key", ",", "expectedVal", ")", "{", "var", "hasValue", "=", "false", ";", "if", "(", "target", "&&", "target", ".", "length", ")", "{", "var", "computedStyles", "=", "$window", ".", "getComputedStyle", "(", "target", "[",...
Checks if the target element has the requested style by key @param {DOMElement|JQLite} target Target element @param {string} key Style key @param {string=} expectedVal Optional expected value @returns {boolean} Whether the target element has the style or not
[ "Checks", "if", "the", "target", "element", "has", "the", "requested", "style", "by", "key" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L35-L44
4,948
angular/material
src/core/util/util.js
function(nodes) { nodes = nodes || []; var results = []; for (var i = 0; i < nodes.length; ++i) { results.push(nodes.item(i)); } return results; }
javascript
function(nodes) { nodes = nodes || []; var results = []; for (var i = 0; i < nodes.length; ++i) { results.push(nodes.item(i)); } return results; }
[ "function", "(", "nodes", ")", "{", "nodes", "=", "nodes", "||", "[", "]", ";", "var", "results", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "nodes", ".", "length", ";", "++", "i", ")", "{", "results", ".", "push", ...
Annoying method to copy nodes to an array, thanks to IE
[ "Annoying", "method", "to", "copy", "nodes", "to", "an", "array", "thanks", "to", "IE" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L144-L152
4,949
angular/material
src/core/util/util.js
function(containerEl, attributeVal) { var AUTO_FOCUS = this.prefixer('md-autofocus', true); var elToFocus; elToFocus = scanForFocusable(containerEl, attributeVal || AUTO_FOCUS); if (!elToFocus && attributeVal != AUTO_FOCUS) { // Scan for deprecated attribute elToFocus = scanFor...
javascript
function(containerEl, attributeVal) { var AUTO_FOCUS = this.prefixer('md-autofocus', true); var elToFocus; elToFocus = scanForFocusable(containerEl, attributeVal || AUTO_FOCUS); if (!elToFocus && attributeVal != AUTO_FOCUS) { // Scan for deprecated attribute elToFocus = scanFor...
[ "function", "(", "containerEl", ",", "attributeVal", ")", "{", "var", "AUTO_FOCUS", "=", "this", ".", "prefixer", "(", "'md-autofocus'", ",", "true", ")", ";", "var", "elToFocus", ";", "elToFocus", "=", "scanForFocusable", "(", "containerEl", ",", "attributeVa...
Finds the proper focus target by searching the DOM. @param containerEl @param attributeVal @returns {*}
[ "Finds", "the", "proper", "focus", "target", "by", "searching", "the", "DOM", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L176-L214
4,950
angular/material
src/core/util/util.js
disableElementScroll
function disableElementScroll(element) { element = angular.element(element || body); var scrollMask; if (options.disableScrollMask) { scrollMask = element; } else { scrollMask = angular.element( '<div class="md-scroll-mask">' + ' <div class=...
javascript
function disableElementScroll(element) { element = angular.element(element || body); var scrollMask; if (options.disableScrollMask) { scrollMask = element; } else { scrollMask = angular.element( '<div class="md-scroll-mask">' + ' <div class=...
[ "function", "disableElementScroll", "(", "element", ")", "{", "element", "=", "angular", ".", "element", "(", "element", "||", "body", ")", ";", "var", "scrollMask", ";", "if", "(", "options", ".", "disableScrollMask", ")", "{", "scrollMask", "=", "element",...
Creates a virtual scrolling mask to prevent touchmove, keyboard, scrollbar clicking, and wheel events
[ "Creates", "a", "virtual", "scrolling", "mask", "to", "prevent", "touchmove", "keyboard", "scrollbar", "clicking", "and", "wheel", "events" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L252-L282
4,951
angular/material
src/core/util/util.js
disableBodyScroll
function disableBodyScroll() { var documentElement = $document[0].documentElement; var prevDocumentStyle = documentElement.style.cssText || ''; var prevBodyStyle = body.style.cssText || ''; var viewportTop = $mdUtil.getViewportTop(); $mdUtil.disableScrollAround._viewPortTop = v...
javascript
function disableBodyScroll() { var documentElement = $document[0].documentElement; var prevDocumentStyle = documentElement.style.cssText || ''; var prevBodyStyle = body.style.cssText || ''; var viewportTop = $mdUtil.getViewportTop(); $mdUtil.disableScrollAround._viewPortTop = v...
[ "function", "disableBodyScroll", "(", ")", "{", "var", "documentElement", "=", "$document", "[", "0", "]", ".", "documentElement", ";", "var", "prevDocumentStyle", "=", "documentElement", ".", "style", ".", "cssText", "||", "''", ";", "var", "prevBodyStyle", "...
Converts the body to a position fixed block and translate it to the proper scroll position
[ "Converts", "the", "body", "to", "a", "position", "fixed", "block", "and", "translate", "it", "to", "the", "proper", "scroll", "position" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L285-L321
4,952
angular/material
src/core/util/util.js
function(element) { var node = element[0] || element; document.addEventListener('click', function focusOnClick(ev) { if (ev.target === node && ev.$focus) { node.focus(); ev.stopImmediatePropagation(); ev.preventDefault(); node.removeEventListener('click', foc...
javascript
function(element) { var node = element[0] || element; document.addEventListener('click', function focusOnClick(ev) { if (ev.target === node && ev.$focus) { node.focus(); ev.stopImmediatePropagation(); ev.preventDefault(); node.removeEventListener('click', foc...
[ "function", "(", "element", ")", "{", "var", "node", "=", "element", "[", "0", "]", "||", "element", ";", "document", ".", "addEventListener", "(", "'click'", ",", "function", "focusOnClick", "(", "ev", ")", "{", "if", "(", "ev", ".", "target", "===", ...
Mobile safari only allows you to set focus in click event listeners...
[ "Mobile", "safari", "only", "allows", "you", "to", "set", "focus", "in", "click", "event", "listeners", "..." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L349-L367
4,953
angular/material
src/core/util/util.js
throttle
function throttle(func, delay) { var recent; return function throttled() { var context = this; var args = arguments; var now = $mdUtil.now(); if (!recent || (now - recent > delay)) { func.apply(context, args); recent = now; } }; }
javascript
function throttle(func, delay) { var recent; return function throttled() { var context = this; var args = arguments; var now = $mdUtil.now(); if (!recent || (now - recent > delay)) { func.apply(context, args); recent = now; } }; }
[ "function", "throttle", "(", "func", ",", "delay", ")", "{", "var", "recent", ";", "return", "function", "throttled", "(", ")", "{", "var", "context", "=", "this", ";", "var", "args", "=", "arguments", ";", "var", "now", "=", "$mdUtil", ".", "now", "...
Returns a function that can only be triggered every `delay` milliseconds. In other words, the function will not be called unless it has been more than `delay` milliseconds since the last call.
[ "Returns", "a", "function", "that", "can", "only", "be", "triggered", "every", "delay", "milliseconds", ".", "In", "other", "words", "the", "function", "will", "not", "be", "called", "unless", "it", "has", "been", "more", "than", "delay", "milliseconds", "si...
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L447-L459
4,954
angular/material
src/core/util/util.js
reconnectScope
function reconnectScope(scope) { if (!scope) return; // we can't disconnect the root node or scope already disconnected if (scope.$root === scope) return; if (!scope.$$disconnected) return; var child = scope; var parent = child.$parent; child.$$disconnected = false; //...
javascript
function reconnectScope(scope) { if (!scope) return; // we can't disconnect the root node or scope already disconnected if (scope.$root === scope) return; if (!scope.$$disconnected) return; var child = scope; var parent = child.$parent; child.$$disconnected = false; //...
[ "function", "reconnectScope", "(", "scope", ")", "{", "if", "(", "!", "scope", ")", "return", ";", "// we can't disconnect the root node or scope already disconnected", "if", "(", "scope", ".", "$root", "===", "scope", ")", "return", ";", "if", "(", "!", "scope"...
Undo the effects of disconnectScope above.
[ "Undo", "the", "effects", "of", "disconnectScope", "above", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L519-L538
4,955
angular/material
src/core/util/util.js
scanChildren
function scanChildren(element) { var found; if (element) { for (var i = 0, len = element.length; i < len; i++) { var target = element[i]; if (!found) { for (var j = 0, numChild = target.childNodes.length; j < numChild; j++) { found = found ...
javascript
function scanChildren(element) { var found; if (element) { for (var i = 0, len = element.length; i < len; i++) { var target = element[i]; if (!found) { for (var j = 0, numChild = target.childNodes.length; j < numChild; j++) { found = found ...
[ "function", "scanChildren", "(", "element", ")", "{", "var", "found", ";", "if", "(", "element", ")", "{", "for", "(", "var", "i", "=", "0", ",", "len", "=", "element", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "var", "targ...
Scan children of specified node
[ "Scan", "children", "of", "specified", "node" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L629-L642
4,956
angular/material
src/core/util/util.js
function(scope, attr, defaults) { defaults = defaults || {}; angular.forEach(scope.$$isolateBindings, function(binding, key) { if (binding.optional && angular.isUndefined(scope[key])) { var attrIsDefined = angular.isDefined(attr[binding.attrName]); scope[key] = angular.isDefined(...
javascript
function(scope, attr, defaults) { defaults = defaults || {}; angular.forEach(scope.$$isolateBindings, function(binding, key) { if (binding.optional && angular.isUndefined(scope[key])) { var attrIsDefined = angular.isDefined(attr[binding.attrName]); scope[key] = angular.isDefined(...
[ "function", "(", "scope", ",", "attr", ",", "defaults", ")", "{", "defaults", "=", "defaults", "||", "{", "}", ";", "angular", ".", "forEach", "(", "scope", ".", "$$isolateBindings", ",", "function", "(", "binding", ",", "key", ")", "{", "if", "(", "...
Give optional properties with no value a boolean true if attr provided or false otherwise
[ "Give", "optional", "properties", "with", "no", "value", "a", "boolean", "true", "if", "attr", "provided", "or", "false", "otherwise" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L649-L657
4,957
angular/material
src/core/util/util.js
processQueue
function processQueue() { var queue = nextTick.queue; var digest = nextTick.digest; nextTick.queue = []; nextTick.timeout = null; nextTick.digest = false; queue.forEach(function(queueItem) { var skip = queueItem.scope && queueItem.scope.$$destroyed; ...
javascript
function processQueue() { var queue = nextTick.queue; var digest = nextTick.digest; nextTick.queue = []; nextTick.timeout = null; nextTick.digest = false; queue.forEach(function(queueItem) { var skip = queueItem.scope && queueItem.scope.$$destroyed; ...
[ "function", "processQueue", "(", ")", "{", "var", "queue", "=", "nextTick", ".", "queue", ";", "var", "digest", "=", "nextTick", ".", "digest", ";", "nextTick", ".", "queue", "=", "[", "]", ";", "nextTick", ".", "timeout", "=", "null", ";", "nextTick",...
Grab a copy of the current queue Clear the queue for future use Process the existing queue Trigger digest if necessary
[ "Grab", "a", "copy", "of", "the", "current", "queue", "Clear", "the", "queue", "for", "future", "use", "Process", "the", "existing", "queue", "Trigger", "digest", "if", "necessary" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L695-L711
4,958
angular/material
src/core/util/util.js
function (element) { var parent = element.parent(); // jqLite might return a non-null, but still empty, parent; so check for parent and length while (hasComputedStyle(parent, 'pointer-events', 'none')) { parent = parent.parent(); } return parent; }
javascript
function (element) { var parent = element.parent(); // jqLite might return a non-null, but still empty, parent; so check for parent and length while (hasComputedStyle(parent, 'pointer-events', 'none')) { parent = parent.parent(); } return parent; }
[ "function", "(", "element", ")", "{", "var", "parent", "=", "element", ".", "parent", "(", ")", ";", "// jqLite might return a non-null, but still empty, parent; so check for parent and length", "while", "(", "hasComputedStyle", "(", "parent", ",", "'pointer-events'", ","...
Scan up dom hierarchy for enabled parent;
[ "Scan", "up", "dom", "hierarchy", "for", "enabled", "parent", ";" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L733-L742
4,959
angular/material
src/core/util/util.js
function() { var stickyProp; var testEl = angular.element('<div>'); $document[0].body.appendChild(testEl[0]); var stickyProps = ['sticky', '-webkit-sticky']; for (var i = 0; i < stickyProps.length; ++i) { testEl.css({ position: stickyProps[i], top: 0, ...
javascript
function() { var stickyProp; var testEl = angular.element('<div>'); $document[0].body.appendChild(testEl[0]); var stickyProps = ['sticky', '-webkit-sticky']; for (var i = 0; i < stickyProps.length; ++i) { testEl.css({ position: stickyProps[i], top: 0, ...
[ "function", "(", ")", "{", "var", "stickyProp", ";", "var", "testEl", "=", "angular", ".", "element", "(", "'<div>'", ")", ";", "$document", "[", "0", "]", ".", "body", ".", "appendChild", "(", "testEl", "[", "0", "]", ")", ";", "var", "stickyProps",...
Checks if the current browser is natively supporting the `sticky` position. @returns {string} supported sticky property name
[ "Checks", "if", "the", "current", "browser", "is", "natively", "supporting", "the", "sticky", "position", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L757-L779
4,960
angular/material
src/core/util/util.js
function(element) { var parent = $mdUtil.getClosest(element, 'form'); var form = parent ? angular.element(parent).controller('form') : null; return form ? form.$submitted : false; }
javascript
function(element) { var parent = $mdUtil.getClosest(element, 'form'); var form = parent ? angular.element(parent).controller('form') : null; return form ? form.$submitted : false; }
[ "function", "(", "element", ")", "{", "var", "parent", "=", "$mdUtil", ".", "getClosest", "(", "element", ",", "'form'", ")", ";", "var", "form", "=", "parent", "?", "angular", ".", "element", "(", "parent", ")", ".", "controller", "(", "'form'", ")", ...
Returns true if the parent form of the element has been submitted. @param element An AngularJS or HTML5 element. @returns {boolean}
[ "Returns", "true", "if", "the", "parent", "form", "of", "the", "element", "has", "been", "submitted", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L803-L808
4,961
angular/material
src/core/util/util.js
function(element, scrollEnd, duration) { var scrollStart = element.scrollTop; var scrollChange = scrollEnd - scrollStart; var scrollingDown = scrollStart < scrollEnd; var startTime = $mdUtil.now(); $$rAF(scrollChunk); function scrollChunk() { var newPosition = calculateNewP...
javascript
function(element, scrollEnd, duration) { var scrollStart = element.scrollTop; var scrollChange = scrollEnd - scrollStart; var scrollingDown = scrollStart < scrollEnd; var startTime = $mdUtil.now(); $$rAF(scrollChunk); function scrollChunk() { var newPosition = calculateNewP...
[ "function", "(", "element", ",", "scrollEnd", ",", "duration", ")", "{", "var", "scrollStart", "=", "element", ".", "scrollTop", ";", "var", "scrollChange", "=", "scrollEnd", "-", "scrollStart", ";", "var", "scrollingDown", "=", "scrollStart", "<", "scrollEnd"...
Animate the requested element's scrollTop to the requested scrollPosition with basic easing. @param {!Element} element The element to scroll. @param {number} scrollEnd The new/final scroll position. @param {number=} duration Duration of the scroll. Default is 1000ms.
[ "Animate", "the", "requested", "element", "s", "scrollTop", "to", "the", "requested", "scrollPosition", "with", "basic", "easing", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L817-L854
4,962
angular/material
src/core/util/util.js
function(array) { if (!array) { return; } return array.filter(function(value, index, self) { return self.indexOf(value) === index; }); }
javascript
function(array) { if (!array) { return; } return array.filter(function(value, index, self) { return self.indexOf(value) === index; }); }
[ "function", "(", "array", ")", "{", "if", "(", "!", "array", ")", "{", "return", ";", "}", "return", "array", ".", "filter", "(", "function", "(", "value", ",", "index", ",", "self", ")", "{", "return", "self", ".", "indexOf", "(", "value", ")", ...
Provides an easy mechanism for removing duplicates from an array. var myArray = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4]; $mdUtil.uniq(myArray) => [1, 2, 3, 4] @param {array} array The array whose unique values should be returned. @returns {array} A copy of the array containing only unique values.
[ "Provides", "an", "easy", "mechanism", "for", "removing", "duplicates", "from", "an", "array", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L867-L873
4,963
angular/material
src/core/util/util.js
function(element) { // For SVG or Symbol elements, innerHTML returns `undefined` in IE. // Reference: https://stackoverflow.com/q/28129956/633107 // The XMLSerializer API is supported on IE11 and is the recommended workaround. var serializer = new XMLSerializer(); return Array.prototype.m...
javascript
function(element) { // For SVG or Symbol elements, innerHTML returns `undefined` in IE. // Reference: https://stackoverflow.com/q/28129956/633107 // The XMLSerializer API is supported on IE11 and is the recommended workaround. var serializer = new XMLSerializer(); return Array.prototype.m...
[ "function", "(", "element", ")", "{", "// For SVG or Symbol elements, innerHTML returns `undefined` in IE.", "// Reference: https://stackoverflow.com/q/28129956/633107", "// The XMLSerializer API is supported on IE11 and is the recommended workaround.", "var", "serializer", "=", "new", "XMLS...
Gets the inner HTML content of the given HTMLElement. Only intended for use with SVG or Symbol elements in IE11. @param {Element} element @returns {string} the inner HTML of the element passed in
[ "Gets", "the", "inner", "HTML", "content", "of", "the", "given", "HTMLElement", ".", "Only", "intended", "for", "use", "with", "SVG", "or", "Symbol", "elements", "in", "IE11", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L881-L890
4,964
angular/material
src/components/autocomplete/autocomplete.spec.js
fakeItemMatch
function fakeItemMatch() { var matches = []; for (var i = 0; i < dropdownItems; i++) { matches.push('Item ' + i); } return matches; }
javascript
function fakeItemMatch() { var matches = []; for (var i = 0; i < dropdownItems; i++) { matches.push('Item ' + i); } return matches; }
[ "function", "fakeItemMatch", "(", ")", "{", "var", "matches", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "dropdownItems", ";", "i", "++", ")", "{", "matches", ".", "push", "(", "'Item '", "+", "i", ")", ";", "}", "retu...
Function to create fake matches with the given dropdown items. Useful when running tests against the dropdown max items calculations. @returns {Array} Fake matches.
[ "Function", "to", "create", "fake", "matches", "with", "the", "given", "dropdown", "items", ".", "Useful", "when", "running", "tests", "against", "the", "dropdown", "max", "items", "calculations", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/autocomplete/autocomplete.spec.js#L2456-L2464
4,965
angular/material
src/components/input/input.js
calculateInputValueLength
function calculateInputValueLength(value) { value = ngTrim && !isPasswordInput && angular.isString(value) ? value.trim() : value; if (value === undefined || value === null) { value = ''; } return String(value).length; }
javascript
function calculateInputValueLength(value) { value = ngTrim && !isPasswordInput && angular.isString(value) ? value.trim() : value; if (value === undefined || value === null) { value = ''; } return String(value).length; }
[ "function", "calculateInputValueLength", "(", "value", ")", "{", "value", "=", "ngTrim", "&&", "!", "isPasswordInput", "&&", "angular", ".", "isString", "(", "value", ")", "?", "value", ".", "trim", "(", ")", ":", "value", ";", "if", "(", "value", "===",...
Calculate the input value's length after coercing it to a string and trimming it if appropriate. @param value {*} the input's value @returns {number} calculated length of the input's value
[ "Calculate", "the", "input", "value", "s", "length", "after", "coercing", "it", "to", "a", "string", "and", "trimming", "it", "if", "appropriate", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/input/input.js#L733-L739
4,966
angular/material
src/components/datepicker/js/calendarYear.js
calendarDirective
function calendarDirective() { return { template: '<div class="md-calendar-scroll-mask">' + '<md-virtual-repeat-container class="md-calendar-scroll-container">' + '<table role="grid" tabindex="0" class="md-calendar" aria-readonly="true">' + '<tbody ' + ...
javascript
function calendarDirective() { return { template: '<div class="md-calendar-scroll-mask">' + '<md-virtual-repeat-container class="md-calendar-scroll-container">' + '<table role="grid" tabindex="0" class="md-calendar" aria-readonly="true">' + '<tbody ' + ...
[ "function", "calendarDirective", "(", ")", "{", "return", "{", "template", ":", "'<div class=\"md-calendar-scroll-mask\">'", "+", "'<md-virtual-repeat-container class=\"md-calendar-scroll-container\">'", "+", "'<table role=\"grid\" tabindex=\"0\" class=\"md-calendar\" aria-readonly=\"true\...
Private component, representing a list of years in the calendar.
[ "Private", "component", "representing", "a", "list", "of", "years", "in", "the", "calendar", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/calendarYear.js#L14-L44
4,967
angular/material
src/components/panel/panel.js
definePreset
function definePreset(name, preset) { if (!name || !preset) { throw new Error('mdPanelProvider: The panel preset definition is ' + 'malformed. The name and preset object are required.'); } else if (_presets.hasOwnProperty(name)) { throw new Error('mdPanelProvider: The panel preset you have requested...
javascript
function definePreset(name, preset) { if (!name || !preset) { throw new Error('mdPanelProvider: The panel preset definition is ' + 'malformed. The name and preset object are required.'); } else if (_presets.hasOwnProperty(name)) { throw new Error('mdPanelProvider: The panel preset you have requested...
[ "function", "definePreset", "(", "name", ",", "preset", ")", "{", "if", "(", "!", "name", "||", "!", "preset", ")", "{", "throw", "new", "Error", "(", "'mdPanelProvider: The panel preset definition is '", "+", "'malformed. The name and preset object are required.'", "...
Takes the passed in panel configuration object and adds it to the `_presets` object at the specified name. @param {string} name Name of the preset to set. @param {!Object} preset Specific configuration object that can contain any and all of the parameters available within the `$mdPanel.create` method. However, paramete...
[ "Takes", "the", "passed", "in", "panel", "configuration", "object", "and", "adds", "it", "to", "the", "_presets", "object", "at", "the", "specified", "name", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/panel/panel.js#L966-L981
4,968
angular/material
src/components/panel/panel.js
getComputedTranslations
function getComputedTranslations(el, property) { // The transform being returned by `getComputedStyle` is in the format: // `matrix(a, b, c, d, translateX, translateY)` if defined and `none` // if the element doesn't have a transform. var transform = getComputedStyle(el[0] || el)[property]; var openIndex = tr...
javascript
function getComputedTranslations(el, property) { // The transform being returned by `getComputedStyle` is in the format: // `matrix(a, b, c, d, translateX, translateY)` if defined and `none` // if the element doesn't have a transform. var transform = getComputedStyle(el[0] || el)[property]; var openIndex = tr...
[ "function", "getComputedTranslations", "(", "el", ",", "property", ")", "{", "// The transform being returned by `getComputedStyle` is in the format:", "// `matrix(a, b, c, d, translateX, translateY)` if defined and `none`", "// if the element doesn't have a transform.", "var", "transform", ...
Gets the computed values for an element's translateX and translateY in px. @param {!angular.JQLite|!Element} el @param {string} property @return {{x: number, y: number}}
[ "Gets", "the", "computed", "values", "for", "an", "element", "s", "translateX", "and", "translateY", "in", "px", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/panel/panel.js#L3530-L3550
4,969
angular/material
docs/app/js/anchor.js
createContentURL
function createContentURL() { var path = ''; var name = element.text(); // Use $window.location.pathname to get the path with the baseURL included. // $location.path() does not include the baseURL. This is important to support how the docs // are deployed with baseURLs like /late...
javascript
function createContentURL() { var path = ''; var name = element.text(); // Use $window.location.pathname to get the path with the baseURL included. // $location.path() does not include the baseURL. This is important to support how the docs // are deployed with baseURLs like /late...
[ "function", "createContentURL", "(", ")", "{", "var", "path", "=", "''", ";", "var", "name", "=", "element", ".", "text", "(", ")", ";", "// Use $window.location.pathname to get the path with the baseURL included.", "// $location.path() does not include the baseURL. This is i...
Creates URL from the text content of the element and writes it into the scope.
[ "Creates", "URL", "from", "the", "text", "content", "of", "the", "element", "and", "writes", "it", "into", "the", "scope", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/docs/app/js/anchor.js#L43-L61
4,970
angular/material
src/components/autocomplete/js/autocompleteParentScopeDirective.js
watchVariable
function watchVariable(variable, alias) { newScope[alias] = scope[variable]; scope.$watch(variable, function(value) { $mdUtil.nextTick(function() { newScope[alias] = value; }); }); }
javascript
function watchVariable(variable, alias) { newScope[alias] = scope[variable]; scope.$watch(variable, function(value) { $mdUtil.nextTick(function() { newScope[alias] = value; }); }); }
[ "function", "watchVariable", "(", "variable", ",", "alias", ")", "{", "newScope", "[", "alias", "]", "=", "scope", "[", "variable", "]", ";", "scope", ".", "$watch", "(", "variable", ",", "function", "(", "value", ")", "{", "$mdUtil", ".", "nextTick", ...
Creates a watcher for variables that are copied from the parent scope @param variable @param alias
[ "Creates", "a", "watcher", "for", "variables", "that", "are", "copied", "from", "the", "parent", "scope" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/autocomplete/js/autocompleteParentScopeDirective.js#L36-L44
4,971
angular/material
src/core/services/layout/layout.js
buildCloakInterceptor
function buildCloakInterceptor(className) { return ['$timeout', function($timeout){ return { restrict : 'A', priority : -10, // run after normal ng-cloak compile : function(element) { if (!config.enabled) return angular.noop; // Re-add the cloak elemen...
javascript
function buildCloakInterceptor(className) { return ['$timeout', function($timeout){ return { restrict : 'A', priority : -10, // run after normal ng-cloak compile : function(element) { if (!config.enabled) return angular.noop; // Re-add the cloak elemen...
[ "function", "buildCloakInterceptor", "(", "className", ")", "{", "return", "[", "'$timeout'", ",", "function", "(", "$timeout", ")", "{", "return", "{", "restrict", ":", "'A'", ",", "priority", ":", "-", "10", ",", "// run after normal ng-cloak", "compile", ":...
Tail-hook ngCloak to delay the uncloaking while Layout transformers finish processing. Eliminates flicker with Material.Layouts
[ "Tail", "-", "hook", "ngCloak", "to", "delay", "the", "uncloaking", "while", "Layout", "transformers", "finish", "processing", ".", "Eliminates", "flicker", "with", "Material", ".", "Layouts" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/layout/layout.js#L215-L237
4,972
angular/material
src/core/services/layout/layout.js
function(element) { if (!config.enabled) return angular.noop; // Re-add the cloak element.addClass(className); return function(scope, element) { // Wait while layout injectors configure, then uncloak // NOTE: $rAF does not delay enough... and this is a 1...
javascript
function(element) { if (!config.enabled) return angular.noop; // Re-add the cloak element.addClass(className); return function(scope, element) { // Wait while layout injectors configure, then uncloak // NOTE: $rAF does not delay enough... and this is a 1...
[ "function", "(", "element", ")", "{", "if", "(", "!", "config", ".", "enabled", ")", "return", "angular", ".", "noop", ";", "// Re-add the cloak", "element", ".", "addClass", "(", "className", ")", ";", "return", "function", "(", "scope", ",", "element", ...
run after normal ng-cloak
[ "run", "after", "normal", "ng", "-", "cloak" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/layout/layout.js#L220-L234
4,973
angular/material
src/core/services/layout/layout.js
updateClassWithValue
function updateClassWithValue(element, className) { var lastClass; return function updateClassFn(newValue) { var value = validateAttributeValue(className, newValue || ""); if (angular.isDefined(value)) { if (lastClass) element.removeClass(lastClass); lastClass = !value ? className :...
javascript
function updateClassWithValue(element, className) { var lastClass; return function updateClassFn(newValue) { var value = validateAttributeValue(className, newValue || ""); if (angular.isDefined(value)) { if (lastClass) element.removeClass(lastClass); lastClass = !value ? className :...
[ "function", "updateClassWithValue", "(", "element", ",", "className", ")", "{", "var", "lastClass", ";", "return", "function", "updateClassFn", "(", "newValue", ")", "{", "var", "value", "=", "validateAttributeValue", "(", "className", ",", "newValue", "||", "\"...
After link-phase, do NOT remove deprecated layout attribute selector. Instead watch the attribute so interpolated data-bindings to layout selectors will continue to be supported. $observe() the className and update with new class (after removing the last one) e.g. `layout="{{layoutDemo.direction}}"` will update... N...
[ "After", "link", "-", "phase", "do", "NOT", "remove", "deprecated", "layout", "attribute", "selector", ".", "Instead", "watch", "the", "attribute", "so", "interpolated", "data", "-", "bindings", "to", "layout", "selectors", "will", "continue", "to", "be", "sup...
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/layout/layout.js#L356-L367
4,974
angular/material
src/core/services/layout/layout.js
warnAttrNotSupported
function warnAttrNotSupported(className) { var parts = className.split("-"); return ["$log", function($log) { $log.warn(className + "has been deprecated. Please use a `" + parts[0] + "-gt-<xxx>` variant."); return angular.noop; }]; }
javascript
function warnAttrNotSupported(className) { var parts = className.split("-"); return ["$log", function($log) { $log.warn(className + "has been deprecated. Please use a `" + parts[0] + "-gt-<xxx>` variant."); return angular.noop; }]; }
[ "function", "warnAttrNotSupported", "(", "className", ")", "{", "var", "parts", "=", "className", ".", "split", "(", "\"-\"", ")", ";", "return", "[", "\"$log\"", ",", "function", "(", "$log", ")", "{", "$log", ".", "warn", "(", "className", "+", "\"has ...
Provide console warning that this layout attribute has been deprecated
[ "Provide", "console", "warning", "that", "this", "layout", "attribute", "has", "been", "deprecated" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/layout/layout.js#L373-L379
4,975
angular/material
src/core/services/layout/layout.js
validateAttributeValue
function validateAttributeValue(className, value, updateFn) { var origValue; if (!needsInterpolation(value)) { switch (className.replace(SUFFIXES,"")) { case 'layout' : if (!findIn(value, LAYOUT_OPTIONS)) { value = LAYOUT_OPTIONS[0]; // 'row'; } ...
javascript
function validateAttributeValue(className, value, updateFn) { var origValue; if (!needsInterpolation(value)) { switch (className.replace(SUFFIXES,"")) { case 'layout' : if (!findIn(value, LAYOUT_OPTIONS)) { value = LAYOUT_OPTIONS[0]; // 'row'; } ...
[ "function", "validateAttributeValue", "(", "className", ",", "value", ",", "updateFn", ")", "{", "var", "origValue", ";", "if", "(", "!", "needsInterpolation", "(", "value", ")", ")", "{", "switch", "(", "className", ".", "replace", "(", "SUFFIXES", ",", "...
For the Layout attribute value, validate or replace with default fallback value
[ "For", "the", "Layout", "attribute", "value", "validate", "or", "replace", "with", "default", "fallback", "value" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/layout/layout.js#L409-L455
4,976
angular/material
src/core/services/layout/layout.js
buildUpdateFn
function buildUpdateFn(element, className, attrs) { return function updateAttrValue(fallback) { if (!needsInterpolation(fallback)) { // Do not modify the element's attribute value; so // uses '<ui-layout layout="/api/sidebar.html" />' will not // be affected. Just update the attrs valu...
javascript
function buildUpdateFn(element, className, attrs) { return function updateAttrValue(fallback) { if (!needsInterpolation(fallback)) { // Do not modify the element's attribute value; so // uses '<ui-layout layout="/api/sidebar.html" />' will not // be affected. Just update the attrs valu...
[ "function", "buildUpdateFn", "(", "element", ",", "className", ",", "attrs", ")", "{", "return", "function", "updateAttrValue", "(", "fallback", ")", "{", "if", "(", "!", "needsInterpolation", "(", "fallback", ")", ")", "{", "// Do not modify the element's attribu...
Replace current attribute value with fallback value
[ "Replace", "current", "attribute", "value", "with", "fallback", "value" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/layout/layout.js#L460-L469
4,977
angular/material
src/components/slider/slider.js
positionToPercent
function positionToPercent(position) { var offset = vertical ? sliderDimensions.top : sliderDimensions.left; var size = vertical ? sliderDimensions.height : sliderDimensions.width; var calc = (position - offset) / size; if (!vertical && $mdUtil.bidi() === 'rtl') { calc = 1 - calc; ...
javascript
function positionToPercent(position) { var offset = vertical ? sliderDimensions.top : sliderDimensions.left; var size = vertical ? sliderDimensions.height : sliderDimensions.width; var calc = (position - offset) / size; if (!vertical && $mdUtil.bidi() === 'rtl') { calc = 1 - calc; ...
[ "function", "positionToPercent", "(", "position", ")", "{", "var", "offset", "=", "vertical", "?", "sliderDimensions", ".", "top", ":", "sliderDimensions", ".", "left", ";", "var", "size", "=", "vertical", "?", "sliderDimensions", ".", "height", ":", "sliderDi...
Convert position on slider to percentage value of offset from beginning... @param position @returns {number}
[ "Convert", "position", "on", "slider", "to", "percentage", "value", "of", "offset", "from", "beginning", "..." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/slider/slider.js#L645-L655
4,978
angular/material
src/components/slider/slider.js
percentToValue
function percentToValue(percent) { var adjustedPercent = invert ? (1 - percent) : percent; return (min + adjustedPercent * (max - min)); }
javascript
function percentToValue(percent) { var adjustedPercent = invert ? (1 - percent) : percent; return (min + adjustedPercent * (max - min)); }
[ "function", "percentToValue", "(", "percent", ")", "{", "var", "adjustedPercent", "=", "invert", "?", "(", "1", "-", "percent", ")", ":", "percent", ";", "return", "(", "min", "+", "adjustedPercent", "*", "(", "max", "-", "min", ")", ")", ";", "}" ]
Convert percentage offset on slide to equivalent model value @param percent @returns {*}
[ "Convert", "percentage", "offset", "on", "slide", "to", "equivalent", "model", "value" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/slider/slider.js#L662-L665
4,979
angular/material
src/core/services/aria/aria.js
expect
function expect(element, attrName, defaultValue) { var node = angular.element(element)[0] || element; // if node exists and neither it nor its children have the attribute if (node && ((!node.hasAttribute(attrName) || node.getAttribute(attrName).length === 0) && !childHasAttribute(no...
javascript
function expect(element, attrName, defaultValue) { var node = angular.element(element)[0] || element; // if node exists and neither it nor its children have the attribute if (node && ((!node.hasAttribute(attrName) || node.getAttribute(attrName).length === 0) && !childHasAttribute(no...
[ "function", "expect", "(", "element", ",", "attrName", ",", "defaultValue", ")", "{", "var", "node", "=", "angular", ".", "element", "(", "element", ")", "[", "0", "]", "||", "element", ";", "// if node exists and neither it nor its children have the attribute", "...
Check if expected attribute has been specified on the target element or child @param element @param attrName @param {optional} defaultValue What to set the attr to if no value is found
[ "Check", "if", "expected", "attribute", "has", "been", "specified", "on", "the", "target", "element", "or", "child" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/aria/aria.js#L80-L98
4,980
angular/material
src/core/services/aria/aria.js
hasAriaLabel
function hasAriaLabel(element) { var node = angular.element(element)[0] || element; /* Check if compatible node type (ie: not HTML Document node) */ if (!node.hasAttribute) { return false; } /* Check label or description attributes */ return node.hasAttribute('aria-label') || node.hasAtt...
javascript
function hasAriaLabel(element) { var node = angular.element(element)[0] || element; /* Check if compatible node type (ie: not HTML Document node) */ if (!node.hasAttribute) { return false; } /* Check label or description attributes */ return node.hasAttribute('aria-label') || node.hasAtt...
[ "function", "hasAriaLabel", "(", "element", ")", "{", "var", "node", "=", "angular", ".", "element", "(", "element", ")", "[", "0", "]", "||", "element", ";", "/* Check if compatible node type (ie: not HTML Document node) */", "if", "(", "!", "node", ".", "hasAt...
Check if expected element has aria label attribute @param element
[ "Check", "if", "expected", "element", "has", "aria", "label", "attribute" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/aria/aria.js#L181-L191
4,981
angular/material
src/core/services/aria/aria.js
parentHasAriaLabel
function parentHasAriaLabel(element, level) { level = level || 1; var node = angular.element(element)[0] || element; if (!node.parentNode) { return false; } if (performCheck(node.parentNode)) { return true; } level--; if (level) { return parentHasAriaLabel(node.parentNo...
javascript
function parentHasAriaLabel(element, level) { level = level || 1; var node = angular.element(element)[0] || element; if (!node.parentNode) { return false; } if (performCheck(node.parentNode)) { return true; } level--; if (level) { return parentHasAriaLabel(node.parentNo...
[ "function", "parentHasAriaLabel", "(", "element", ",", "level", ")", "{", "level", "=", "level", "||", "1", ";", "var", "node", "=", "angular", ".", "element", "(", "element", ")", "[", "0", "]", "||", "element", ";", "if", "(", "!", "node", ".", "...
Check if expected element's parent has aria label attribute and has valid role and tagName @param element @param {optional} level Number of levels deep search should be performed
[ "Check", "if", "expected", "element", "s", "parent", "has", "aria", "label", "attribute", "and", "has", "valid", "role", "and", "tagName" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/aria/aria.js#L198-L321
4,982
angular/material
src/core/util/autofocus.js
updateExpression
function updateExpression(value) { // Rather than passing undefined to the jqLite toggle class function we explicitly set the // value to true. Otherwise the class will be just toggled instead of being forced. if (angular.isUndefined(value)) { value = true; } element.toggleClass(...
javascript
function updateExpression(value) { // Rather than passing undefined to the jqLite toggle class function we explicitly set the // value to true. Otherwise the class will be just toggled instead of being forced. if (angular.isUndefined(value)) { value = true; } element.toggleClass(...
[ "function", "updateExpression", "(", "value", ")", "{", "// Rather than passing undefined to the jqLite toggle class function we explicitly set the", "// value to true. Otherwise the class will be just toggled instead of being forced.", "if", "(", "angular", ".", "isUndefined", "(", "val...
Updates the autofocus class which is used to determine whether the attribute expression evaluates to true or false. @param {string|boolean} value Attribute Value
[ "Updates", "the", "autofocus", "class", "which", "is", "used", "to", "determine", "whether", "the", "attribute", "expression", "evaluates", "to", "true", "or", "false", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/autofocus.js#L117-L126
4,983
angular/material
config/ngModuleData.js
buildScanner
function buildScanner(pattern) { return function findPatternIn(content) { let dependencies; const match = pattern.exec(content || ''); const moduleName = match ? match[1].replace(/'/gi,'') : null; const depsMatch = match && match[2] && match[2].trim(); if (depsMatch) { dependencies = depsM...
javascript
function buildScanner(pattern) { return function findPatternIn(content) { let dependencies; const match = pattern.exec(content || ''); const moduleName = match ? match[1].replace(/'/gi,'') : null; const depsMatch = match && match[2] && match[2].trim(); if (depsMatch) { dependencies = depsM...
[ "function", "buildScanner", "(", "pattern", ")", "{", "return", "function", "findPatternIn", "(", "content", ")", "{", "let", "dependencies", ";", "const", "match", "=", "pattern", ".", "exec", "(", "content", "||", "''", ")", ";", "const", "moduleName", "...
Find module definition s that match the module definition pattern
[ "Find", "module", "definition", "s", "that", "match", "the", "module", "definition", "pattern" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/config/ngModuleData.js#L21-L42
4,984
angular/material
src/components/progressCircular/js/progressCircularDirective.js
getDashLength
function getDashLength(diameter, strokeWidth, value, limit) { return (diameter - strokeWidth) * $window.Math.PI * ((3 * (limit || 100) / 100) - (value/100)); }
javascript
function getDashLength(diameter, strokeWidth, value, limit) { return (diameter - strokeWidth) * $window.Math.PI * ((3 * (limit || 100) / 100) - (value/100)); }
[ "function", "getDashLength", "(", "diameter", ",", "strokeWidth", ",", "value", ",", "limit", ")", "{", "return", "(", "diameter", "-", "strokeWidth", ")", "*", "$window", ".", "Math", ".", "PI", "*", "(", "(", "3", "*", "(", "limit", "||", "100", ")...
Return stroke length for progress circle @param {number} diameter Diameter of the container. @param {number} strokeWidth Stroke width to be used when drawing circle @param {number} value Percentage of circle (between 0 and 100) @param {number} limit Max percentage for circle @returns {number} Stroke length for progre...
[ "Return", "stroke", "length", "for", "progress", "circle" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/progressCircular/js/progressCircularDirective.js#L337-L339
4,985
angular/material
src/components/tooltip/tooltip.js
MdTooltipRegistry
function MdTooltipRegistry() { var listeners = {}; var ngWindow = angular.element(window); return { register: register, deregister: deregister }; /** * Global event handler that dispatches the registered handlers in the * service. * @param {!Event} event Event object passed in by the browse...
javascript
function MdTooltipRegistry() { var listeners = {}; var ngWindow = angular.element(window); return { register: register, deregister: deregister }; /** * Global event handler that dispatches the registered handlers in the * service. * @param {!Event} event Event object passed in by the browse...
[ "function", "MdTooltipRegistry", "(", ")", "{", "var", "listeners", "=", "{", "}", ";", "var", "ngWindow", "=", "angular", ".", "element", "(", "window", ")", ";", "return", "{", "register", ":", "register", ",", "deregister", ":", "deregister", "}", ";"...
Service that is used to reduce the amount of listeners that are being registered on the `window` by the tooltip component. Works by collecting the individual event handlers and dispatching them from a global handler. @ngInject
[ "Service", "that", "is", "used", "to", "reduce", "the", "amount", "of", "listeners", "that", "are", "being", "registered", "on", "the", "window", "by", "the", "tooltip", "component", ".", "Works", "by", "collecting", "the", "individual", "event", "handlers", ...
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tooltip/tooltip.js#L423-L483
4,986
angular/material
src/components/tooltip/tooltip.js
globalEventHandler
function globalEventHandler(event) { if (listeners[event.type]) { listeners[event.type].forEach(function(currentHandler) { currentHandler.call(this, event); }, this); } }
javascript
function globalEventHandler(event) { if (listeners[event.type]) { listeners[event.type].forEach(function(currentHandler) { currentHandler.call(this, event); }, this); } }
[ "function", "globalEventHandler", "(", "event", ")", "{", "if", "(", "listeners", "[", "event", ".", "type", "]", ")", "{", "listeners", "[", "event", ".", "type", "]", ".", "forEach", "(", "function", "(", "currentHandler", ")", "{", "currentHandler", "...
Global event handler that dispatches the registered handlers in the service. @param {!Event} event Event object passed in by the browser
[ "Global", "event", "handler", "that", "dispatches", "the", "registered", "handlers", "in", "the", "service", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tooltip/tooltip.js#L437-L443
4,987
angular/material
src/components/tooltip/tooltip.js
register
function register(type, handler, useCapture) { var handlers = listeners[type] = listeners[type] || []; if (!handlers.length) { useCapture ? window.addEventListener(type, globalEventHandler, true) : ngWindow.on(type, globalEventHandler); } if (handlers.indexOf(handler) === -1) { h...
javascript
function register(type, handler, useCapture) { var handlers = listeners[type] = listeners[type] || []; if (!handlers.length) { useCapture ? window.addEventListener(type, globalEventHandler, true) : ngWindow.on(type, globalEventHandler); } if (handlers.indexOf(handler) === -1) { h...
[ "function", "register", "(", "type", ",", "handler", ",", "useCapture", ")", "{", "var", "handlers", "=", "listeners", "[", "type", "]", "=", "listeners", "[", "type", "]", "||", "[", "]", ";", "if", "(", "!", "handlers", ".", "length", ")", "{", "...
Registers a new handler with the service. @param {string} type Type of event to be registered. @param {!Function} handler Event handler. @param {boolean} useCapture Whether to use event capturing.
[ "Registers", "a", "new", "handler", "with", "the", "service", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tooltip/tooltip.js#L451-L462
4,988
angular/material
src/components/tooltip/tooltip.js
deregister
function deregister(type, handler, useCapture) { var handlers = listeners[type]; var index = handlers ? handlers.indexOf(handler) : -1; if (index > -1) { handlers.splice(index, 1); if (handlers.length === 0) { useCapture ? window.removeEventListener(type, globalEventHandler, true) : ...
javascript
function deregister(type, handler, useCapture) { var handlers = listeners[type]; var index = handlers ? handlers.indexOf(handler) : -1; if (index > -1) { handlers.splice(index, 1); if (handlers.length === 0) { useCapture ? window.removeEventListener(type, globalEventHandler, true) : ...
[ "function", "deregister", "(", "type", ",", "handler", ",", "useCapture", ")", "{", "var", "handlers", "=", "listeners", "[", "type", "]", ";", "var", "index", "=", "handlers", "?", "handlers", ".", "indexOf", "(", "handler", ")", ":", "-", "1", ";", ...
Removes an event handler from the service. @param {string} type Type of event handler. @param {!Function} handler The event handler itself. @param {boolean} useCapture Whether the event handler used event capturing.
[ "Removes", "an", "event", "handler", "from", "the", "service", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tooltip/tooltip.js#L470-L482
4,989
angular/material
src/components/datepicker/js/calendar.spec.js
findCellByLabel
function findCellByLabel(monthElement, day) { var tds = monthElement.querySelectorAll('td'); var td; for (var i = 0; i < tds.length; i++) { td = tds[i]; if (td.textContent === day.toString()) { return td; } } }
javascript
function findCellByLabel(monthElement, day) { var tds = monthElement.querySelectorAll('td'); var td; for (var i = 0; i < tds.length; i++) { td = tds[i]; if (td.textContent === day.toString()) { return td; } } }
[ "function", "findCellByLabel", "(", "monthElement", ",", "day", ")", "{", "var", "tds", "=", "monthElement", ".", "querySelectorAll", "(", "'td'", ")", ";", "var", "td", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "tds", ".", "length", ";",...
Finds a td given a label.
[ "Finds", "a", "td", "given", "a", "label", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/calendar.spec.js#L44-L54
4,990
angular/material
src/components/datepicker/js/calendar.spec.js
findMonthElement
function findMonthElement(element, date) { var months = element.querySelectorAll('[md-calendar-month-body]'); var monthHeader = dateLocale.monthHeaderFormatter(date); var month; for (var i = 0; i < months.length; i++) { month = months[i]; if (month.querySelector('tr:first-child td:first-chi...
javascript
function findMonthElement(element, date) { var months = element.querySelectorAll('[md-calendar-month-body]'); var monthHeader = dateLocale.monthHeaderFormatter(date); var month; for (var i = 0; i < months.length; i++) { month = months[i]; if (month.querySelector('tr:first-child td:first-chi...
[ "function", "findMonthElement", "(", "element", ",", "date", ")", "{", "var", "months", "=", "element", ".", "querySelectorAll", "(", "'[md-calendar-month-body]'", ")", ";", "var", "monthHeader", "=", "dateLocale", ".", "monthHeaderFormatter", "(", "date", ")", ...
Finds a month `tbody` in the calendar element given a date.
[ "Finds", "a", "month", "tbody", "in", "the", "calendar", "element", "given", "a", "date", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/calendar.spec.js#L59-L71
4,991
angular/material
src/components/datepicker/js/calendar.spec.js
findYearElement
function findYearElement(parent, year) { var node = parent[0] || parent; var years = node.querySelectorAll('[md-calendar-year-body]'); var yearHeader = year.toString(); var target; for (var i = 0; i < years.length; i++) { target = years[i]; if (target.querySelector('.md-calendar-month-l...
javascript
function findYearElement(parent, year) { var node = parent[0] || parent; var years = node.querySelectorAll('[md-calendar-year-body]'); var yearHeader = year.toString(); var target; for (var i = 0; i < years.length; i++) { target = years[i]; if (target.querySelector('.md-calendar-month-l...
[ "function", "findYearElement", "(", "parent", ",", "year", ")", "{", "var", "node", "=", "parent", "[", "0", "]", "||", "parent", ";", "var", "years", "=", "node", ".", "querySelectorAll", "(", "'[md-calendar-year-body]'", ")", ";", "var", "yearHeader", "=...
Find the `tbody` for a year in the calendar.
[ "Find", "the", "tbody", "for", "a", "year", "in", "the", "calendar", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/calendar.spec.js#L74-L87
4,992
angular/material
src/components/datepicker/js/calendar.spec.js
createElement
function createElement(parentScope, templateOverride) { var directiveScope = parentScope || $rootScope.$new(); var template = templateOverride || '<md-calendar md-min-date="minDate" md-max-date="maxDate" ' + 'ng-model="myDate"></md-calendar>'; var attachedElement = angular.element(template); doc...
javascript
function createElement(parentScope, templateOverride) { var directiveScope = parentScope || $rootScope.$new(); var template = templateOverride || '<md-calendar md-min-date="minDate" md-max-date="maxDate" ' + 'ng-model="myDate"></md-calendar>'; var attachedElement = angular.element(template); doc...
[ "function", "createElement", "(", "parentScope", ",", "templateOverride", ")", "{", "var", "directiveScope", "=", "parentScope", "||", "$rootScope", ".", "$new", "(", ")", ";", "var", "template", "=", "templateOverride", "||", "'<md-calendar md-min-date=\"minDate\" md...
Creates and compiles an md-calendar element.
[ "Creates", "and", "compiles", "an", "md", "-", "calendar", "element", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/calendar.spec.js#L99-L109
4,993
angular/material
src/components/datepicker/js/calendar.spec.js
dispatchKeyEvent
function dispatchKeyEvent(keyCode, opt_modifiers) { var mod = opt_modifiers || {}; angular.element(element).triggerHandler({ type: 'keydown', keyCode: keyCode, which: keyCode, ctrlKey: mod.ctrl, altKey: mod.alt, metaKey: mod.meta, shortKey: mod.shift }); }
javascript
function dispatchKeyEvent(keyCode, opt_modifiers) { var mod = opt_modifiers || {}; angular.element(element).triggerHandler({ type: 'keydown', keyCode: keyCode, which: keyCode, ctrlKey: mod.ctrl, altKey: mod.alt, metaKey: mod.meta, shortKey: mod.shift }); }
[ "function", "dispatchKeyEvent", "(", "keyCode", ",", "opt_modifiers", ")", "{", "var", "mod", "=", "opt_modifiers", "||", "{", "}", ";", "angular", ".", "element", "(", "element", ")", ".", "triggerHandler", "(", "{", "type", ":", "'keydown'", ",", "keyCod...
Dispatches a KeyboardEvent for the calendar. @param {number} keyCode @param {Object=} opt_modifiers
[ "Dispatches", "a", "KeyboardEvent", "for", "the", "calendar", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/calendar.spec.js#L116-L129
4,994
angular/material
src/components/tabs/tabsPaginationService.js
decreasePageOffset
function decreasePageOffset(elements, currentOffset) { var canvas = elements.canvas, tabOffsets = getTabOffsets(elements), i, firstVisibleTabOffset; // Find the first fully visible tab in offset range for (i = 0; i < tabOffsets.length; i++) { if (tabOffsets[i] >= currentOffset...
javascript
function decreasePageOffset(elements, currentOffset) { var canvas = elements.canvas, tabOffsets = getTabOffsets(elements), i, firstVisibleTabOffset; // Find the first fully visible tab in offset range for (i = 0; i < tabOffsets.length; i++) { if (tabOffsets[i] >= currentOffset...
[ "function", "decreasePageOffset", "(", "elements", ",", "currentOffset", ")", "{", "var", "canvas", "=", "elements", ".", "canvas", ",", "tabOffsets", "=", "getTabOffsets", "(", "elements", ")", ",", "i", ",", "firstVisibleTabOffset", ";", "// Find the first fully...
Returns the offset for the next decreasing page. @param elements @param currentOffset @returns {number}
[ "Returns", "the", "offset", "for", "the", "next", "decreasing", "page", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/tabsPaginationService.js#L38-L53
4,995
angular/material
src/components/tabs/tabsPaginationService.js
increasePageOffset
function increasePageOffset(elements, currentOffset) { var canvas = elements.canvas, maxOffset = getTotalTabsWidth(elements) - canvas.clientWidth, tabOffsets = getTabOffsets(elements), i, firstHiddenTabOffset; // Find the first partially (or fully) invisible tab for (i = ...
javascript
function increasePageOffset(elements, currentOffset) { var canvas = elements.canvas, maxOffset = getTotalTabsWidth(elements) - canvas.clientWidth, tabOffsets = getTabOffsets(elements), i, firstHiddenTabOffset; // Find the first partially (or fully) invisible tab for (i = ...
[ "function", "increasePageOffset", "(", "elements", ",", "currentOffset", ")", "{", "var", "canvas", "=", "elements", ".", "canvas", ",", "maxOffset", "=", "getTotalTabsWidth", "(", "elements", ")", "-", "canvas", ".", "clientWidth", ",", "tabOffsets", "=", "ge...
Returns the offset for the next increasing page. @param elements @param currentOffset @returns {number}
[ "Returns", "the", "offset", "for", "the", "next", "increasing", "page", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/tabsPaginationService.js#L62-L75
4,996
angular/material
src/components/tabs/tabsPaginationService.js
getTabOffsets
function getTabOffsets(elements) { var i, tab, currentOffset = 0, offsets = []; for (i = 0; i < elements.tabs.length; i++) { tab = elements.tabs[i]; offsets.push(currentOffset); currentOffset += tab.offsetWidth; } return offsets; }
javascript
function getTabOffsets(elements) { var i, tab, currentOffset = 0, offsets = []; for (i = 0; i < elements.tabs.length; i++) { tab = elements.tabs[i]; offsets.push(currentOffset); currentOffset += tab.offsetWidth; } return offsets; }
[ "function", "getTabOffsets", "(", "elements", ")", "{", "var", "i", ",", "tab", ",", "currentOffset", "=", "0", ",", "offsets", "=", "[", "]", ";", "for", "(", "i", "=", "0", ";", "i", "<", "elements", ".", "tabs", ".", "length", ";", "i", "++", ...
Returns the offsets of all of the tabs based on their widths. @param elements @returns {number[]}
[ "Returns", "the", "offsets", "of", "all", "of", "the", "tabs", "based", "on", "their", "widths", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/tabsPaginationService.js#L83-L93
4,997
angular/material
src/components/tabs/tabsPaginationService.js
getTotalTabsWidth
function getTotalTabsWidth(elements) { var sum = 0, i, tab; for (i = 0; i < elements.tabs.length; i++) { tab = elements.tabs[i]; sum += tab.offsetWidth; } return sum; }
javascript
function getTotalTabsWidth(elements) { var sum = 0, i, tab; for (i = 0; i < elements.tabs.length; i++) { tab = elements.tabs[i]; sum += tab.offsetWidth; } return sum; }
[ "function", "getTotalTabsWidth", "(", "elements", ")", "{", "var", "sum", "=", "0", ",", "i", ",", "tab", ";", "for", "(", "i", "=", "0", ";", "i", "<", "elements", ".", "tabs", ".", "length", ";", "i", "++", ")", "{", "tab", "=", "elements", "...
Sum the width of all tabs. @param elements @returns {number}
[ "Sum", "the", "width", "of", "all", "tabs", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/tabsPaginationService.js#L101-L110
4,998
angular/material
src/core/services/theming/theming.js
function() { return angular.extend({ }, themeConfig, { defaultTheme : defaultTheme, alwaysWatchTheme : alwaysWatchTheme, registeredStyles : [].concat(themeConfig.registeredStyles) }); }
javascript
function() { return angular.extend({ }, themeConfig, { defaultTheme : defaultTheme, alwaysWatchTheme : alwaysWatchTheme, registeredStyles : [].concat(themeConfig.registeredStyles) }); }
[ "function", "(", ")", "{", "return", "angular", ".", "extend", "(", "{", "}", ",", "themeConfig", ",", "{", "defaultTheme", ":", "defaultTheme", ",", "alwaysWatchTheme", ":", "alwaysWatchTheme", ",", "registeredStyles", ":", "[", "]", ".", "concat", "(", "...
return a read-only clone of the current theme configuration
[ "return", "a", "read", "-", "only", "clone", "of", "the", "current", "theme", "configuration" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/theming/theming.js#L297-L303
4,999
angular/material
src/core/services/theming/theming.js
checkPaletteValid
function checkPaletteValid(name, map) { var missingColors = VALID_HUE_VALUES.filter(function(field) { return !map[field]; }); if (missingColors.length) { throw new Error("Missing colors %1 in palette %2!" .replace('%1', missingColors.join(', ')) .repla...
javascript
function checkPaletteValid(name, map) { var missingColors = VALID_HUE_VALUES.filter(function(field) { return !map[field]; }); if (missingColors.length) { throw new Error("Missing colors %1 in palette %2!" .replace('%1', missingColors.join(', ')) .repla...
[ "function", "checkPaletteValid", "(", "name", ",", "map", ")", "{", "var", "missingColors", "=", "VALID_HUE_VALUES", ".", "filter", "(", "function", "(", "field", ")", "{", "return", "!", "map", "[", "field", "]", ";", "}", ")", ";", "if", "(", "missin...
Make sure that palette has all required hues
[ "Make", "sure", "that", "palette", "has", "all", "required", "hues" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/theming/theming.js#L441-L452