Răsfoiți Sursa

[editor] Disable the execute button when the statement is empty instead of hiding it

Johan Ahlen 10 ani în urmă
părinte
comite
11c6ffa

+ 7 - 2
desktop/libs/notebook/src/notebook/static/notebook/css/notebook.css

@@ -776,12 +776,17 @@ table.airy tr td {
   transition: color 0.2s ease;
 }
 
+.snippet-side-btn.disabled {
+  cursor: default !important;
+  color: #DBE8F1 !important;
+}
+
 .snippet-side-btn.active {
-  color: #338bb8 !important;
+  color: #338bb8;
 }
 
 .snippet-side-btn:hover {
-  color: #338bb8 !important;
+  color: #338bb8;
 }
 
 .execution-timer {

+ 1 - 1
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -871,7 +871,7 @@ ${ require.config() }
     <a class="snippet-side-btn" data-bind="click: cancel, visible: status() == 'running'" title="${ _('Cancel') }">
       <i class="fa fa-fw fa-stop"></i>
     </a>
-    <a class="snippet-side-btn" data-bind="click: execute, visible: status() != 'running' && status() != 'loading' && statement() != '', css: {'blue': $parent.history().length == 0}" title="${ _('CTRL + ENTER') }">
+    <a class="snippet-side-btn" data-bind="click: execute, visible: status() != 'running' && status() != 'loading', css: {'blue': $parent.history().length == 0, 'disabled': statement() === '' }" title="${ _('CTRL + ENTER') }">
       <i class="fa fa-fw fa-play"></i>
     </a>
   </div>