Skip to content

Commit

Permalink
silence fomantic error regarding tabs (go-gitea#9713) (go-gitea#9718)
Browse files Browse the repository at this point in the history
Fomantic expects all tabs to have a target element with content as
defined by the data-tab attribute. All our usage of the tab module seems
to use <a> element tabs that link to new pages so these content elements
are never present and fomantic complains about that in the console with
an "Activated tab cannot be found" error. This silences that error.
  • Loading branch information
silverwind authored and techknowlogick committed Jan 12, 2020
1 parent f8ea50c commit fec3544
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web_src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ if (typeof (Dropzone) !== 'undefined') {
Dropzone.autoDiscover = false;
}

// Silence fomantic's error logging when tabs are used without a target content element
$.fn.tab.settings.silent = true;

function initCommentPreviewTab($form) {
const $tabMenu = $form.find('.tabular.menu');
$tabMenu.find('.item').tab();
Expand Down

0 comments on commit fec3544

Please sign in to comment.