Skip to content
Snippets Groups Projects
Commit ea62f4ff authored by Adrian Lang's avatar Adrian Lang
Browse files

Cleanup behaviour.js

  * Add var statement for dw_behaviour
  * Use live instead of click for smb share warnings
parent 2e5fe8c3
No related branches found
No related tags found
No related merge requests found
/*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);
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment