aboutsummaryrefslogtreecommitdiffstats
path: root/static/js/common.js
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-08-04 10:11:24 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-08-04 10:11:24 +0300
commit63b0fc6269b38edf7234b9f151b80d81f614c0a3 (patch)
tree555de3068f33f8dddb4619349bbea7d9b7c822fd /static/js/common.js
downloadServo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.tar.gz
Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.tar.bz2
Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.zip
Initial commit
First public commit
Diffstat (limited to 'static/js/common.js')
-rw-r--r--static/js/common.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/static/js/common.js b/static/js/common.js
new file mode 100644
index 0000000..8b03006
--- /dev/null
+++ b/static/js/common.js
@@ -0,0 +1,37 @@
+/**
+ * common.js
+ */
+ $(function(){
+ $('.disabled').click(function(e) {
+ e.preventDefault();
+ return false;
+ });
+ $('input[type="text"]').attr('autocomplete', 'off');
+
+ $(document).on('click', 'a[data-modal]', function(e){
+
+ if($(this).parent().hasClass('disabled') || $(this).hasClass('disabled')) {
+ return false;
+ }
+
+ $('.wrapper').spin();
+ e.preventDefault();
+
+ $('#modal').load($(this).attr('href'),
+ function(){
+ $('.wrapper').spin(false);
+ $('#modal').modal({'backdrop': 'static'});
+ $('#modal .modal-body input:visible:first').focus();
+
+ $('#gsx-container').load($('#gsx-container').data('source'));
+ $('#modal button[type="submit"]').click(function(e) {
+ $('#modal form').submit();
+ });
+ $('#modal button[type="submit"]').focus();
+ $('#modal .trigger-search').on('click', function(){
+ $('#search-form').submit();
+ });
+ });
+ });
+
+});