public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
Cleaned up DropMenu js and added shadow

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@1243 
567b1171-46fb-0310-a4c9-b4bef9110e78
Caged (author)
Wed Jun 14 15:28:25 -0700 2006
commit  a353f20c25e2c67add34cbf6719690d8670a875c
tree    58945959ff1e30994ae24a4474d342f903e66922
parent  8a2c50d3b16ee81977523fc5299bedfb22884e31
...
7
8
9
10
11
12
13
 
 
 
 
 
 
14
15
16
...
7
8
9
 
 
 
 
10
11
12
13
14
15
16
17
18
0
@@ -7,10 +7,12 @@
0
     <li><%= link_to "Update your account", :controller => 'users', :action => 'show', :id => current_user %></li>
0
     <li id="select">
0
       <a class="trigger" id="cog" href="#">&nbsp;</a>
0
- <ul id="options" style="display:none;">
0
- <li><a href="#" title="title">Test option</a></li>
0
- <li><a href="#" title="title">Other option</a></li>
0
- </ul>
0
+ <div id="optgroup" style="display: none">
0
+ <ul id="options">
0
+ <li><%= check_box_tag 'show_todays_comments' %> Show only todays comments</li>
0
+ <li><a href="#" title="title">Other option</a></li>
0
+ </ul>
0
+ </div>
0
     </li>
0
   </ul>
0
 </div>
...
4
5
6
7
 
8
9
10
...
13
14
15
 
 
16
17
18
...
22
23
24
25
 
26
27
28
...
4
5
6
 
7
8
9
10
...
13
14
15
16
17
18
19
20
...
24
25
26
 
27
28
29
30
0
@@ -4,7 +4,7 @@ DropMenu.prototype = {
0
   initialize: function(element) {
0
     this.menu = $(element);
0
     this.trigger = document.getElementsByClassName('trigger', this.menu)[0];
0
- this.options = $('options');
0
+ this.options = $('optgroup');
0
     this.focused = false;
0
     
0
     Event.observe(this.trigger, 'click', this.onTriggerClick.bindAsEventListener(this));
0
@@ -13,6 +13,8 @@ DropMenu.prototype = {
0
   },
0
   
0
   onTriggerClick: function() {
0
+ clearTimeout(this.timeout);
0
+ this.options.setStyle({opacity: 1});
0
     Element.toggle(this.options);
0
   },
0
   
0
@@ -22,7 +24,7 @@ DropMenu.prototype = {
0
   
0
   onMenuBlur: function() {
0
     this.focused = false;
0
- setTimeout(this.fadeMenu.bind(this), 400);
0
+ this.timeout = setTimeout(this.fadeMenu.bind(this), 400);
0
   },
0
   
0
   fadeMenu: function() {
...
307
308
309
310
 
311
312
313
314
315
 
316
317
 
318
 
 
 
 
 
319
320
321
322
323
324
 
 
 
325
326
327
328
329
330
331
332
333
 
 
334
335
336
337
338
339
340
341
342
343
...
307
308
309
 
310
311
312
313
 
 
314
315
 
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
 
 
336
337
 
338
339
340
341
 
 
 
 
 
342
343
344
0
@@ -307,37 +307,38 @@ input[type='text']:focus, textarea:focus {
0
   outline: none;
0
 }
0
 
0
-#select #options {
0
+#select #optgroup {
0
   position: absolute;
0
   top: 38px;
0
   left: 2px;
0
- width: 200px;
0
- background: #eee;
0
+ width: 240px;
0
   z-index: 9999;
0
- padding: 0;
0
+ padding: 0 5px 5px 0;
0
   margin: 0;
0
+ background: url(../images/shadow.png) bottom right no-repeat;
0
+}
0
+
0
+#select #options {
0
+ background: #eee;
0
   border: 5px solid #fff;
0
 }
0
 
0
 #select #options li {
0
   display: block;
0
   margin: 0;
0
+ padding: 5px;
0
+ border-bottom: 1px dotted #ccc;
0
+ color: #333;
0
 }
0
 
0
 #select #options a {
0
   float: none !important;
0
- display: block;
0
- padding: 5px;
0
   margin: 0;
0
   border: none;
0
- border-bottom: 1px dotted #ccc;
0
+ display: inline;
0
+ padding: 0;
0
 }
0
 
0
-#select #options a:hover {
0
- background: #E9F7F8;
0
- color: #333;
0
- text-shadow: 2px 2px #fff;
0
-}
0
 
0
 
0
 /*

Comments

    No one has commented yet.