summaryrefslogtreecommitdiff
path: root/lib/scripts/behaviour.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scripts/behaviour.js')
-rw-r--r--lib/scripts/behaviour.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js
index 31b82050e..62c20eb0f 100644
--- a/lib/scripts/behaviour.js
+++ b/lib/scripts/behaviour.js
@@ -1,3 +1,6 @@
+/*jslint sloppy: true */
+/*global jQuery, LANG, document, alert */
+
/**
* Automatic behaviours
*
@@ -6,7 +9,7 @@
* class was found
*/
-dw_behaviour = {
+var dw_behaviour = {
init: function(){
dw_behaviour.focusMarker();
@@ -22,15 +25,16 @@ dw_behaviour = {
*/
scrollToMarker: function(){
var obj = jQuery('#scroll__here');
- if(obj.length) obj[0].scrollIntoView();
+ if(obj.length) {
+ obj[0].scrollIntoView();
+ }
},
/**
* Looks for an element with the ID focus__this at sets focus to it
*/
focusMarker: function(){
- var obj = jQuery('#focus__this');
- if(obj.length) obj[0].focus();
+ jQuery('#focus__this').focus();
},
/**
@@ -78,11 +82,13 @@ dw_behaviour = {
* @author Michael Klier <chi@chimeric.de>
*/
checkWindowsShares: function() {
- if(!LANG['nosmblinks']) return true;
- if(document.all != null) return true;
+ if(!LANG.nosmblinks || document.all !== null) {
+ // No warning requested or none necessary
+ return;
+ }
- jQuery('a.windows').click(function(){
- alert(LANG['nosmblinks']);
+ jQuery('a.windows').live('click', function(){
+ alert(LANG.nosmblinks);
});
}