* Move tab functionality to a separate module

* Fix broken library placeholders
* Restrict tab width and add text panning to tab name
* General bugfixing and cleanup of tab functionality
This commit is contained in:
Duncan Sommerville 2015-09-15 18:53:25 -04:00
parent 0d80f857d3
commit 8dcea06077
9 changed files with 272 additions and 225 deletions

View file

@ -289,3 +289,20 @@ function getUsabilityHint() {
});
}
function getPanTextFunctions() {
return {
mousein: function () {
var sw = $(this)[0].scrollWidth-parseFloat($(this).css("textIndent")), iw = $(this).innerWidth();
if (sw > iw) {
$(this).stop().animate({
textIndent: "-" + (sw + 1 - iw) + "px"
}, sw * 8);
}
},
mouseout: function () {
$(this).stop().animate({
textIndent: "0"
}, 500);
}
}
}