From 5b8fda836d1d5c7eb38d4fc0fc34aed63a34520e Mon Sep 17 00:00:00 2001 From: Kuldeep M Date: Tue, 4 Jun 2019 19:34:17 +0100 Subject: [PATCH] [refactor] link tab index --- js/control.js | 4 ++-- js/link.js | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/js/control.js b/js/control.js index c82bc9fb..af048611 100644 --- a/js/control.js +++ b/js/control.js @@ -1809,10 +1809,10 @@ var control = (function() { var _edit = function() { if (state.get().link.edit) { helper.addClass(html, "is-link-edit"); - link.tabIndex(); + link.render.tabIndex(); } else { helper.removeClass(html, "is-link-edit"); - link.tabIndex(); + link.render.tabIndex(); }; }; var _date = function() { diff --git a/js/link.js b/js/link.js index 2dd7a829..5b29bf2d 100644 --- a/js/link.js +++ b/js/link.js @@ -61,7 +61,7 @@ var link = (function() { data.save(); clear(); render.link(); - tabIndex(); + render.tabIndex(); control.dependents(); control.render(); resetStagedBookmarkData(); @@ -114,7 +114,7 @@ var link = (function() { data.save(); clear(); render.link(); - tabIndex(); + render.tabIndex(); _returnToPreviousFocusLink(); resetStagedBookmarkData(); }, @@ -514,6 +514,9 @@ var link = (function() { link: function() { _link(); }, + tabIndex: function() { + _tabIndex(); + }, items: function() { _items(); } @@ -592,7 +595,7 @@ var link = (function() { html.style.setProperty("--link-items-width", state.get().link.items.width + "%"); }; - var tabIndex = function() { + var _tabIndex = function() { var allLinkControlItem = helper.eA(".link-control-item"); if (state.get().link.edit) { allLinkControlItem.forEach(function(arrayItem, index) { @@ -628,8 +631,7 @@ var link = (function() { add: add, edit: edit, remove: remove, - render: render, - tabIndex: tabIndex + render: render }; })();