Browse Source

Fix positioning of tooltip

Scott Lahteine 10 years ago
parent
commit
5d159851e5

+ 2
- 2
Marlin/configurator/css/configurator.css View File

@@ -3,7 +3,7 @@
3 3
 
4 4
 body { margin: 0; padding: 0; background: #56A; color: #FFC; font-family: sans-serif; }
5 5
 
6
-#main { max-width: 1000px; margin: 0 auto; position: relative; }
6
+#main { max-width: 1000px; margin: 0 auto; }
7 7
 #main { padding: 0 4%; width: 92%; }
8 8
 #main { font-family: monospace; }
9 9
 h1, #message { text-align: center; }
@@ -22,7 +22,7 @@ label.newline, textarea, fieldset { clear: both; }
22 22
 label { width: 130px; height: 1em; padding: 10px 480px 10px 1em; margin-right: -470px; text-align: right; }
23 23
 input[type="text"], select { margin: 0.75em 0 0; }
24 24
 input[type="checkbox"], input[type="radio"], input[type="file"] { margin: 1em 0 0; }
25
-#config_form { display: block; background: #DDD; padding: 20px; color: #000; }
25
+#config_form { display: block; background: #DDD; padding: 20px; color: #000; position: relative; }
26 26
 /*#config_text, #config_adv_text { font-family: "Andale mono", monospace; clear: both; }*/
27 27
 #config_text, #config_adv_text { height: 25em; overflow: auto; background-color: #FFF; color: #888; padding: 10px; }
28 28
 input[type="checkbox"], input[type="radio"].enabler { margin-left: 1em; }

+ 2
- 1
Marlin/configurator/index.html View File

@@ -20,10 +20,11 @@
20 20
       </div>
21 21
 
22 22
       <div id="tabs"></div>
23
-      <div id="tooltip"></div>
24 23
 
25 24
       <form id="config_form">
26 25
 
26
+        <div id="tooltip"></div>
27
+
27 28
         <label>Drop Files Here:</label><input type="file" id="file-upload" />
28 29
 
29 30
         <fieldset id="machine">

+ 6
- 6
Marlin/configurator/js/configurator.js View File

@@ -55,6 +55,7 @@ var configuratorApp = (function(){
55 55
       boards_file = 'boards.h',
56 56
       config_file = 'Configuration.h',
57 57
       config_adv_file = 'Configuration_adv.h',
58
+      $tooltip = $('#tooltip'),
58 59
       $config = $('#config_text'),
59 60
       $config_adv = $('#config_adv_text'),
60 61
       boards_list = {},
@@ -360,14 +361,13 @@ var configuratorApp = (function(){
360 361
 
361 362
         if (inf.comment) {
362 363
           var $tipme = $elm.prev('label');
363
-          if (inf.comment && $tipme.length) {
364
-            var $tt = $('#tooltip');
364
+          if ($tipme.length) {
365 365
             $tipme.hover(
366 366
               function() {
367
-                var offs = $tipme.offset();
368
-                $tt.text(inf.comment)
367
+                var pos = $tipme.position();
368
+                $tooltip.text(inf.comment)
369 369
                   .append('<span>')
370
-                  .css({bottom:($tt.parent().height()-offs.top+20)+'px',left:(offs.left+70)+'px'})
370
+                  .css({bottom:($tooltip.parent().outerHeight()-pos.top)+'px',left:(pos.left+70)+'px'})
371 371
                   .show();
372 372
                 if (hover_timer) {
373 373
                   clearTimeout(hover_timer);
@@ -377,7 +377,7 @@ var configuratorApp = (function(){
377 377
               function() {
378 378
                 hover_timer = setTimeout(function(){
379 379
                   hover_timer = null;
380
-                  $tt.fadeOut(400);
380
+                  $tooltip.fadeOut(400);
381 381
                 }, 400);
382 382
               }
383 383
             );

Loading…
Cancel
Save