Skip to content

Commit 7be6e52

Browse files
dbriemmmorgannoble
authored andcommitted
LP#2110907 Staff Portal Links Open in New Tab
Remove ES6 syntax in the AngularJS target service and directive to retain UglifyJS compatibility when building for production. Signed-off-by: Dan Briem <[email protected]> Signed-off-by: Jane Sandberg <[email protected]> Signed-off-by: blake <[email protected]> Signed-off-by: Terran McCanna <[email protected]> Signed-off-by: Michele Morgan <[email protected]>
1 parent 1080112 commit 7be6e52

File tree

1 file changed

+9
-5
lines changed
  • Open-ILS/web/js/ui/default/staff/services

1 file changed

+9
-5
lines changed

Open-ILS/web/js/ui/default/staff/services/ui.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,8 +1691,8 @@ https://stackoverflow.com/questions/24764802/angular-js-automatically-focus-inpu
16911691
.factory('egLinkTargetService', ['egCore', function(egCore) {
16921692
const newTabsDisabledKey = 'ui.staff.disable_links_newtabs';
16931693

1694-
let initSettingLoaded = false;
1695-
let firstSharedResponse = null;
1694+
var initSettingLoaded = false;
1695+
var firstSharedResponse = null;
16961696

16971697
function getSetting() {
16981698
return egCore.hatch.getItem(newTabsDisabledKey);
@@ -1710,7 +1710,7 @@ https://stackoverflow.com/questions/24764802/angular-js-automatically-focus-inpu
17101710
// share first Promise to avoid multiple server requests
17111711
if (!initSettingLoaded) {
17121712
if (!firstSharedResponse) {
1713-
firstSharedResponse = getSetting().finally(() => {
1713+
firstSharedResponse = getSetting().finally(function() {
17141714
initSettingLoaded = true;
17151715
});
17161716
}
@@ -1721,7 +1721,11 @@ https://stackoverflow.com/questions/24764802/angular-js-automatically-focus-inpu
17211721
return getSetting();
17221722
}
17231723

1724-
return { disableNewTabs, enableNewTabs, newTabsDisabled };
1724+
return {
1725+
disableNewTabs: disableNewTabs,
1726+
enableNewTabs: enableNewTabs,
1727+
newTabsDisabled: newTabsDisabled
1728+
};
17251729
}])
17261730

17271731
/**
@@ -1757,7 +1761,7 @@ https://stackoverflow.com/questions/24764802/angular-js-automatically-focus-inpu
17571761
if (SAME_TAB_TARGETS.has(attrs.target)) { return; }
17581762

17591763
egLinkTargetService.newTabsDisabled()
1760-
.then(disabled => {
1764+
.then(function(disabled) {
17611765
if (disabled) {
17621766
elem.attr('target', null);
17631767
} else {

0 commit comments

Comments
 (0)