X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/42965f91217422c94389efd46d45c70f30081165..4e4277b12a41673d67f608609776f34adc9171e2:/redakcja/static/js/wiki/base.js diff --git a/redakcja/static/js/wiki/base.js b/redakcja/static/js/wiki/base.js index 3fa47ccd..8625b112 100644 --- a/redakcja/static/js/wiki/base.js +++ b/redakcja/static/js/wiki/base.js @@ -111,7 +111,7 @@ if($tab.length != 1) $tab = $(DEFAULT_PERSPECTIVE); - var $old = $('#tabs li').filter('.active'); + var $old = $tab.closest('.tabs').find('.active'); $old.each(function(){ $(this).removeClass('active'); @@ -298,15 +298,14 @@ reportErrors: function(errors) { var global = $("*[data-ui-error-for='__all__']", this.$elem); var unassigned = []; - var unassigned_text = ''; + $("*[data-ui-error-for]", this.$elem).text(''); for (var field_name in errors) { var span = $("*[data-ui-error-for='"+field_name+"']", this.$elem); if(!span.length) { unassigned.push(field_name); - unassigned_text += errors[field_name]; continue; } @@ -314,7 +313,7 @@ } if(unassigned.length > 0) - global.text( global.text() + unassigned_text); + global.text( global.text() + 'W formularzu wystąpiły błędy'); } };