center modal
authorAnthony Ly <anthonyly.com@gmail.com>
Wed, 26 Jun 2013 18:21:15 +0200
changeset 174 a1656f70f1c9
parent 165 b4377a741714
child 175 7352c3d88d73
center modal
integration/css/style.css
integration/js/common.js
--- a/integration/css/style.css	Tue Jun 25 10:46:42 2013 +0200
+++ b/integration/css/style.css	Wed Jun 26 18:21:15 2013 +0200
@@ -132,6 +132,8 @@
 .links-rows .help-inline{display: none;}
 
 .shadow {background-color: #54D0ED !important;}
+.modal{width: auto !important; display: inline-block;}
+.modal.popup{height: auto; left: none; margin-left: 0; width: auto;}
 
 /* Tangle */
 .time-tangle {color: #2c3e50; cursor: w-resize; position: relative;border-bottom: 1px dashed #2c3e50;}
--- a/integration/js/common.js	Tue Jun 25 10:46:42 2013 +0200
+++ b/integration/js/common.js	Wed Jun 26 18:21:15 2013 +0200
@@ -4,6 +4,13 @@
        return this.attr(name) !== undefined;
     };
 
+    $('.modal').on('show', function () {
+        var halfWidth = $(this).width() / 2;
+        $(this).css({
+            'margin-left' : - halfWidth +'px'
+        });
+    });
+
 //open modal
     $(document).on('click', 'a.open-modal', function(e){
         e.preventDefault();