Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add tab hover and close x icon behavior after adding a new tab

  • Loading branch information...
commit b8d64f9d40265999c23256a6fc8b37506afd6013 1 parent cea03b1
@azawawi authored
Showing with 24 additions and 11 deletions.
  1. +24 −11 lib/Farabi6/files/farabi.js
View
35 lib/Farabi6/files/farabi.js
@@ -467,22 +467,35 @@ function startFarabi(editorId) {
}
});
- $(".icon-remove").hover(function() {
- $(this).addClass("icon-remove-sign");
- },
- function() {
- $(this).removeClass("icon-remove-sign");
- });
+
+ var addTabBehavior = function() {
+
+ $(".icon-remove").hover(function() {
+ $(this).addClass("icon-remove-sign");
+ },
+ function() {
+ $(this).removeClass("icon-remove-sign");
+ });
+
+ $('a[data-toggle="tab"]').on('shown', function (e) {
+ //e.target // activated tab
+ //e.relatedTarget // previous tab
+ alert("TODO implement editor tab selection");
+ });
+
+
+ $(".icon-remove").on('click', function() {
+ $(this).parent().remove();
+ });
+ };
+
+ addTabBehavior();
$(".new-file-button").click(function() {
$("#myTab").append('<li><a href="#home" data-toggle="tab">Home&nbsp;&nbsp;<i class="icon-remove"></i></a></li>');
+ addTabBehavior();
});
- $('a[data-toggle="tab"]').on('shown', function (e) {
- //e.target // activated tab
- //e.relatedTarget // previous tab
- alert("TODO implement editor tab selection");
- });
}
function runOnPerlito6(source) {
Please sign in to comment.
Something went wrong with that request. Please try again.