Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions js/plugins/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
var type = $('input[name=type]:checked').val();
var mparent = $('#sl_parent').val();
var content = $('#txt_content').val();
var id = 'bs_tab' + e.timeStamp;
var id = 'bs_tab' + guid();

if (type == 'tab') {
if (mparent == '') {
Expand Down Expand Up @@ -276,7 +276,7 @@
<button class="tab-delete btn"><i class="icon-trash"></i> Remove</button>';


var id = 'bs_tab' + e.timeStamp;
var id = 'bs_tab' + guid();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion to add an underscore after 'bs_tab' for the id. So, var id = 'bs_tab_' + guid();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just replaced e.timeStamp and did not think about this. Thank you.


if (type != 1) {
if (mparent == '') {
Expand All @@ -293,6 +293,13 @@
$('#' + id).trigger('click')
}
});

function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
}
return s4() + '-' + s4();
}
});
</script>
</head>
Expand Down