gigaZhang / struts2-jquery

Automatically exported from code.google.com/p/struts2-jquery
0 stars 0 forks source link

Closable tab does not work #1068

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Struts 2 jquery 3.6.1

To reproduce: declare a "sj:tab" as closable.

Deprecated live method and remove option.

Original code:

if (closable) {

             $("#"+o.id+" span.s2j-tab-closable").live('click', function() {

             var index = $('li',$elem).index($(this).parent());

             $elem.tabs('remove', index);

        });

}

Fix:

if (closable) {

             $("#"+o.id).on('click', "span.s2j-tab-closable", function() {

             var index = $('li',$elem).index($(this).parent());

             var tab = $elem.find(".ui-tabs-nav li:eq("+index+")").remove();

             $elem.tabs("refresh");

        });

}

Thanks.

Original issue reported on code.google.com by fggd.mar...@gmail.com on 29 Dec 2013 at 12:48

GoogleCodeExporter commented 9 years ago
File: jquery.ui.struts2.js

Original comment by fggd.mar...@gmail.com on 29 Dec 2013 at 12:58

GoogleCodeExporter commented 9 years ago

Original comment by johgep on 10 Apr 2014 at 7:25

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/struts2-jquery/source/detail?r=1868

Thank you for the patch!

Original comment by johgep on 10 Apr 2014 at 7:44

GoogleCodeExporter commented 9 years ago

Original comment by johgep on 10 Apr 2014 at 7:44

GoogleCodeExporter commented 9 years ago

Original comment by johgep on 13 May 2014 at 7:03