Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

perf(tabs): remove unreferenced elements variable from TabsController #11379

Merged
merged 1 commit into from
Jul 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/components/tabs/js/tabsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
// define private properties
var ctrl = this,
locked = false,
elements = getElements(),
queue = [],
destroyed = false,
loaded = false;


// Define public methods
ctrl.$onInit = $onInit;
ctrl.updatePagination = $mdUtil.debounce(updatePagination, 100);
Expand Down Expand Up @@ -94,10 +92,6 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
bindEvents();
$mdTheming($element);
$mdUtil.nextTick(function () {
// Note that the element references need to be updated, because certain "browsers"
// (IE/Edge) lose them and start throwing "Invalid calling object" errors, when we
// compile the element contents down in `compileElement`.
elements = getElements();
updateHeightFromContent();
adjustOffset();
updateInkBarStyles();
Expand Down Expand Up @@ -469,7 +463,7 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp

/**
* Gathers references to all of the DOM elements used by this controller.
* @returns {{}}
* @returns {Object}
*/
function getElements () {
var elements = {};
Expand Down Expand Up @@ -716,7 +710,7 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
extraOffset = 32;

// If we are selecting the first tab (in LTR and RTL), always set the offset to 0
if (index == 0) {
if (index === 0) {
ctrl.offsetLeft = 0;
return;
}
Expand Down Expand Up @@ -926,6 +920,6 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
}

function isRtl() {
return ($mdUtil.bidi() == 'rtl');
return ($mdUtil.bidi() === 'rtl');
}
}