aboutsummaryrefslogtreecommitdiffstats
path: root/servo/static/js/common.js
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2017-04-24 10:36:10 +0300
committerFilipp Lepalaan <filipp@mac.com>2017-04-24 10:36:10 +0300
commitc1e043b7ba78cee73d13ded9ef03b256202540f1 (patch)
tree2b913aaf4c3c45972cff707afd76d9ad901d40ba /servo/static/js/common.js
parentef376c2cf80cb89c3c5a5dc79c39c5045406b5e7 (diff)
downloadServo-c1e043b7ba78cee73d13ded9ef03b256202540f1.tar.gz
Servo-c1e043b7ba78cee73d13ded9ef03b256202540f1.tar.bz2
Servo-c1e043b7ba78cee73d13ded9ef03b256202540f1.zip
Move STATIC_ROOT inside app directory
Diffstat (limited to 'servo/static/js/common.js')
-rw-r--r--servo/static/js/common.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/servo/static/js/common.js b/servo/static/js/common.js
new file mode 100644
index 0000000..8b03006
--- /dev/null
+++ b/servo/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();
+ });
+ });
+ });
+
+});