Add moveable filter popup
authorJoey Schulze <joey@infodrom.org>
Sat, 29 Aug 2015 18:25:27 +0000 (18:25 +0000)
committerJoey Schulze <joey@infodrom.org>
Sat, 29 Aug 2015 18:25:27 +0000 (18:25 +0000)
src/InfoCon/account/list.wml

index 7b4334d..cb48266 100644 (file)
@@ -113,6 +113,22 @@ if (!empty($_POST['ajax']) && $_POST['ajax'] == 1) {
 <account_heading>
 <form_to_yyyymmdd>
 
+<style type="text/css">
+div#filter_popup {
+    background: white;
+    border: 1px solid #CCC;
+    height:auto;
+    width:340px;
+    position:absolute;
+}
+div#filter_title {
+    width: 100%;
+    cursor: move;
+    background: #EEE;
+    margin-bottom: 5px;
+    font-weight: bold;
+}
+</style>
 <table class="border smallfont" width=100% border=0 cellpadding=0 cellspacing=1>
 <thead>
 <tr class=head>
@@ -136,6 +152,8 @@ $(function(){
        else
            $(this).css('backgroundColor','');
     });
+    $('body').append('<script type="text/javascript" src="../../jquery.udraggable.js"><\/script>');
+    $('body').append('<script type="text/javascript" src="../../jquery.event.ue.js"><\/script>');
 });
 
 function filter_popup()
@@ -152,13 +170,17 @@ function filter_popup()
                  text += '</style>';
                  text += $(data).find('form').html();
                  $('#filter_popup form').html(text);
+
+                 $('#filter_popup').udraggable({
+                     'handle': 'div#filter_title'
+                 }).css('top', '70px').css('left', '103px');
+
                  $('#filter_popup form input.button[type="submit"]').click(function(e){
                      $.post('list.php',
                             'ajax=1&'+$('#filter_popup form').serialize(),
                             function(data){
                                 $('table.border tbody').html(data);
                             });
-                     console.log($('#filter_popup form').serialize());
                      return false;
                  });
          });
@@ -173,10 +195,12 @@ function filter_popup()
 }
 
 </script></protect>
-<div id="filter_popup" style="background:white;border:1px solid #CCC;height:auto;width:330px;position:absolute;right:10px;top:10px;padding:5px;display:none;">
-<div style="background:#EEE;margin-bottom:5px;font-weight:bold;">Filter setzen</div>
+<div id="filter_popup" style="display:none;">
+<div id="filter_title">Filter setzen</div>
+<div style="padding:5px;">
 <form id="filter_form"></form>
 </div>
+</div>
 </page>
 
 # Local variables: