From ae71b1331f7915c753fa636dbff40822c8a602d5 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Tue, 11 Feb 2014 00:43:20 -0300 Subject: [PATCH] fix focus on modal --- wise-webapp/src/main/webapp/js/mindmapList.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wise-webapp/src/main/webapp/js/mindmapList.js b/wise-webapp/src/main/webapp/js/mindmapList.js index adf1a632..bdb27ccc 100644 --- a/wise-webapp/src/main/webapp/js/mindmapList.js +++ b/wise-webapp/src/main/webapp/js/mindmapList.js @@ -170,8 +170,8 @@ jQuery.fn.dialogForm = function (options) { }); // Open the modal dialog ... - this.on('shown', function() { - $('#' + containerId + ' input:first').focus(); + this.on('shown.bs.modal', function() { + $(this).find('input:first').focus(); }); this.modal(); @@ -466,10 +466,9 @@ $(function () { var dataTable = $('#mindmapListTable').dataTable(); //remove the selected tag... $("#foldersContainer li.active").remove(); - //find the second li... (all) - $("#foldersContainer li:nth-child(2)").addClass("active"); + $("#foldersContainer li:first").addClass("active"); $('#foldersContainer .active i').addClass('icon-white'); - $("#foldersContainer li:nth-child(2)").animate({left: '+=8px'}, 'fast'); + $("#foldersContainer li:first").animate({left: '+=8px'}, 'fast'); dataTable.fnReloadAjax("c/restful/maps/?q=all", callbackOnTableInit, true); } })