summaryrefslogtreecommitdiff
path: root/lib/scripts/qsearch.js
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-11-30 12:30:40 +0100
committerAndreas Gohr <andi@splitbrain.org>2012-11-30 12:30:40 +0100
commitd14415e37072dbe16077efd700aee5bd33707b54 (patch)
tree062c3c190039ac9490f56598b0ee116de18c2480 /lib/scripts/qsearch.js
parent2ed38036a53a489d2fcadc46ce601f8c876fca31 (diff)
parent38479cbba628ee76a92ff5f3c974cfa8e6ce9e61 (diff)
downloadrpg-d14415e37072dbe16077efd700aee5bd33707b54.tar.gz
rpg-d14415e37072dbe16077efd700aee5bd33707b54.tar.bz2
Merge branch 'master' into subscription
* master: (175 commits) some coding style improvements added .idea project folder to gitignore use correct setUp method and parent calls. Correct German plugin manager translation (download != install) correct return in sendDigest() Fix case-insensitive match in ACL checking GeSHi update to 1.0.8.11 ignore empty header on mail sending remove empty BCC/CC mail headers Galician language update some welcome page changes Combine subsequent calls to strtr into a single transformation changed semicolon to colon in link to welcome page to make it less confusing fixed wrong sidebar showing in namespaces when sidebar is disabled Typo fix for TL;DR removed a bunch of outdated and irrelevant networking acronyms added another place to look for logo to make it more consistent (FS#2656) French language update Czech language update compat js findPosX/y more closely mimic historical function ... Conflicts: inc/auth.php inc/common.php inc/subscription.php lib/exe/indexer.php
Diffstat (limited to 'lib/scripts/qsearch.js')
-rw-r--r--lib/scripts/qsearch.js25
1 files changed, 20 insertions, 5 deletions
diff --git a/lib/scripts/qsearch.js b/lib/scripts/qsearch.js
index a309f9e29..c3d0d94fb 100644
--- a/lib/scripts/qsearch.js
+++ b/lib/scripts/qsearch.js
@@ -92,12 +92,18 @@ var dw_qsearch = {
.show()
.css('white-space', 'nowrap');
- // shorten namespaces if too long
- max = dw_qsearch.$outObj[0].clientWidth;
+ // disable overflow during shortening
+ dw_qsearch.$outObj.find('li').css('overflow', 'visible');
+
$links = dw_qsearch.$outObj.find('a');
- too_big = (document.documentElement.dir === 'rtl')
- ? function (l) { return l.offsetLeft < 0; }
- : function (l) { return l.offsetWidth + l.offsetLeft > max; };
+ max = dw_qsearch.$outObj[0].clientWidth; // maximum width allowed (but take away paddings below)
+ if(document.documentElement.dir === 'rtl'){
+ max -= parseInt(dw_qsearch.$outObj.css('padding-left'));
+ too_big = function (l) { return l.offsetLeft < 0; };
+ }else{
+ max -= parseInt(dw_qsearch.$outObj.css('padding-right'));
+ too_big = function (l) { return l.offsetWidth + l.offsetLeft > max; };
+ }
$links.each(function () {
var start, length, replace, nsL, nsR, eli, runaway;
@@ -106,6 +112,12 @@ var dw_qsearch = {
return;
}
+ // make IE's innerText available to W3C conform browsers
+ if(this.textContent){
+ this.__defineGetter__('innerText', function(){ return this.textContent });
+ this.__defineSetter__('innerText', function(val){ this.textContent = val });
+ }
+
nsL = this.innerText.indexOf('(');
nsR = this.innerText.indexOf(')');
eli = 0;
@@ -138,6 +150,9 @@ var dw_qsearch = {
nsR = this.innerText.indexOf(')');
}
});
+
+ // reenable overflow
+ dw_qsearch.$outObj.find('li').css('overflow', 'hidden').css('text-overflow','ellipsis');
}
};