Lines 91-93
function confirmModal(message, title, yes_label, no_label, callback) {
Link Here
|
91 |
$("#bootstrap-confirm-box-modal-cancel").text( no_label || 'Cancel' ); |
91 |
$("#bootstrap-confirm-box-modal-cancel").text( no_label || 'Cancel' ); |
92 |
$("#bootstrap-confirm-box-modal").modal('show'); |
92 |
$("#bootstrap-confirm-box-modal").modal('show'); |
93 |
} |
93 |
} |
94 |
- |
94 |
|
|
|
95 |
//Add jQuery :focusable selector |
96 |
(function($) { |
97 |
function visible(element) { |
98 |
return $.expr.filters.visible(element) && !$(element).parents().addBack().filter(function() { |
99 |
return $.css(this, 'visibility') === 'hidden'; |
100 |
}).length; |
101 |
} |
102 |
|
103 |
function focusable(element, isTabIndexNotNaN) { |
104 |
var map, mapName, img, nodeName = element.nodeName.toLowerCase(); |
105 |
if ('area' === nodeName) { |
106 |
map = element.parentNode; |
107 |
mapName = map.name; |
108 |
if (!element.href || !mapName || map.nodeName.toLowerCase() !== 'map') { |
109 |
return false; |
110 |
} |
111 |
img = $('img[usemap=#' + mapName + ']')[0]; |
112 |
return !!img && visible(img); |
113 |
} |
114 |
return (/input|select|textarea|button|object/.test(nodeName) ? |
115 |
!element.disabled : |
116 |
'a' === nodeName ? |
117 |
element.href || isTabIndexNotNaN : |
118 |
isTabIndexNotNaN) && |
119 |
// the element and all of its ancestors must be visible |
120 |
visible(element); |
121 |
} |
122 |
|
123 |
$.extend($.expr[':'], { |
124 |
focusable: function(element) { |
125 |
return focusable(element, !isNaN($.attr(element, 'tabindex'))); |
126 |
} |
127 |
}); |
128 |
})(jQuery); |
129 |
|
130 |
$("#scrolltocontent").click(function() { |
131 |
var content = $(".maincontent"); |
132 |
if (content.length > 0) { |
133 |
$('html,body').animate({ |
134 |
scrollTop: content.first().offset().top |
135 |
}, |
136 |
'slow'); |
137 |
content.first().find(':focusable').eq(0).focus(); |
138 |
} |
139 |
}); |