Author: assaf
Date: Thu Jun  5 16:26:31 2008
New Revision: 663776

URL: http://svn.apache.org/viewvc?rev=663776&view=rev
Log:
Fixed task view rendering, using SalesForce form as test case.

Modified:
    ode/sandbox/singleshot/app/views/tasks/show.html.erb
    ode/sandbox/singleshot/public/javascripts/application.js
    ode/sandbox/singleshot/public/stylesheets/default.css

Modified: ode/sandbox/singleshot/app/views/tasks/show.html.erb
URL: 
http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/views/tasks/show.html.erb?rev=663776&r1=663775&r2=663776&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/views/tasks/show.html.erb (original)
+++ ode/sandbox/singleshot/app/views/tasks/show.html.erb Thu Jun  5 16:26:31 
2008
@@ -8,8 +8,12 @@
     <div class='actions'>
       <%= quick_actions(@task) %>
       <%= content_tag 'button', 'More Options', 
:onclick=>"Singleshot.expand(event, '.header .details', 'Less options')", 
:class=>'button-to' %>
+      <%= button_to 'Completed', task_url(@task, :status=>'completed'), 
:title=>'Click when task completed' if performing && 
@task.rendering.use_completion_button?  %>
+    </div>
+    <div class='vitals'>
+      <p class='title'><%= h(@task.title) %></p>
+      <p class='info'><%= task_vitals(@task) %></p>
     </div>
-    <div class='vitals'><p class='title'><%= h(@task.title) %></p><p 
class='info'><%= task_vitals(@task) %></p></div>
     <div class='details' style='display:none'>
       <dl>
         <%= content_tag('dt', 'Description') + content_tag('dd', 
sanitize(simple_format(@task.description))) unless use_description %>
@@ -29,12 +33,6 @@
     <div class='description'><%= sanitize(simple_format(@task.description)) 
%></div>
   <% else %>
     <%= task_frame @task, performing %>
-    <%= javascript_tag "Singleshot.taskView('task_frame')" %>
-  <% end %>
-
-  <% if performing && @task.rendering.use_completion_button? %>
-    <div class='footer'>
-      <div class='actions'><%= button_to 'Completed', task_url(@task, 
:status=>'completed'), :title=>'Click when task completed' %></div>
-    </div>
+    <%= javascript_tag "Singleshot.setFrameSize('task_frame')" %>
   <% end %>
 <% end %>

Modified: ode/sandbox/singleshot/public/javascripts/application.js
URL: 
http://svn.apache.org/viewvc/ode/sandbox/singleshot/public/javascripts/application.js?rev=663776&r1=663775&r2=663776&view=diff
==============================================================================
--- ode/sandbox/singleshot/public/javascripts/application.js (original)
+++ ode/sandbox/singleshot/public/javascripts/application.js Thu Jun  5 
16:26:31 2008
@@ -2,32 +2,33 @@
 // This file is automatically included by javascript_include_tag :defaults
 //
 var Singleshot = {
-  // Returns the SingleShot.TaskView object.
-  taskView: function(target) {
+  setFrameSize: function(target) {
     target = $$(target).first() || $(target);
     // Adjust lower frame to expand and fit the reminder of the window.
     // Do it once now, and each time the window is resized.
     var adjust = function() {
-      target.style.height = window.innerHeight - target.offsetTop;
+      target.style.height = window.innerHeight - target.offsetTop + 'px';
     }
     Event.observe(window, 'resize', adjust);
-    adjust();
-    Singleshot.taskView = function() { };
+    Event.observe(window, 'load', adjust);
   },
 
+  // Called to show/hide (or expand/collapse) the target element on click.
   expand: function(event, target, alternative) {
     event = event || window.event;
     var source = Event.element(event);
     target = $$(target).first() || $(target);
     if (target.visible()) {
-      source.innerHTML = source.originalText; 
+      if (source.originalText)
+        source.innerHTML = source.originalText; 
       target.hide();
     } else if (event.shiftKey || event.ctrlKey || event.metaKey) {
       return;
     } else {
-      source.originalText = source.innerHTML;
-      if (alternative)
+      if (alternative) {
+        source.originalText = source.innerHTML;
         source.innerHTML = alternative;
+      }
       target.show();
     }
     Event.stop(event);

Modified: ode/sandbox/singleshot/public/stylesheets/default.css
URL: 
http://svn.apache.org/viewvc/ode/sandbox/singleshot/public/stylesheets/default.css?rev=663776&r1=663775&r2=663776&view=diff
==============================================================================
--- ode/sandbox/singleshot/public/stylesheets/default.css (original)
+++ ode/sandbox/singleshot/public/stylesheets/default.css Thu Jun  5 16:26:31 
2008
@@ -356,8 +356,8 @@
   width: 100%;
   height: 0;
   padding: 0;
-  margin: 3em 0 0 0;
-  background: transparent;
+  margin: 3.5em 0 0 0;
+  background: #fff;
 }
 
 div.task div.footer {


Reply via email to