From 62c07107c1e562494c08dbf258ef9f526d668adb Mon Sep 17 00:00:00 2001
From: Naomi Aro <naomiaro@gmail.com>
Date: Mon, 5 Mar 2012 14:43:34 +0100
Subject: [PATCH] CC-3174 : showbuilder

dialog improvements, can scroll library, builder independently.
---
 airtime_mvc/public/css/showbuilder.css        | 14 ++++++++++-
 .../public/js/airtime/schedule/schedule.js    | 24 +++++++++++++++----
 2 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/airtime_mvc/public/css/showbuilder.css b/airtime_mvc/public/css/showbuilder.css
index a0a7d8e82..c17319817 100644
--- a/airtime_mvc/public/css/showbuilder.css
+++ b/airtime_mvc/public/css/showbuilder.css
@@ -47,10 +47,22 @@ tr.cursor-selected-row .marker {
 .ui-dialog .wrapper {
     margin: 0;
     padding: 10px 0 0 0;
+    overflow: hidden;
+}
+
+.ui-dialog #library_content {
+    margin: 0 10px 10px 0;
+    overflow: auto;
+    min-height: 0;
 }
 
 .ui-dialog #show_builder {
-    width:45%;
+    margin: 0 0 10px 0;
+    overflow: auto;   
+}
+
+.ui-dialog .padded {
+    padding: 8px 10px 8px 8px;
 }
 
 .ui-dialog .ui-buttonset {
diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js
index e93be7df3..192a64488 100644
--- a/airtime_mvc/public/js/airtime/schedule/schedule.js
+++ b/airtime_mvc/public/js/airtime/schedule/schedule.js
@@ -100,15 +100,31 @@ function buildScheduleDialog (json) {
 	
 	var dialog = $(json.dialog),
 		viewport = findViewportDimensions(),
-		height = viewport.height * 0.96,
-		width = viewport.width * 0.96,
-		fnServer = AIRTIME.showbuilder.fnServerData;
-    
+		height = Math.floor(viewport.height * 0.96),
+		width = Math.floor(viewport.width * 0.96),
+		fnServer = AIRTIME.showbuilder.fnServerData,
+		//subtract padding in pixels
+		widgetWidth = width - 50,
+		libWidth = Math.floor(widgetWidth * 0.5),
+		builderWidth = Math.floor(widgetWidth * 0.5);
+	
+	
+	
+	dialog.find("#library_content")
+		.height(height - 125)
+		.width(libWidth);
+	
+	dialog.find("#show_builder")
+		.height(height - 125)
+		.width(builderWidth);
+	
 	dialog.dialog({
 		autoOpen: false,
 		title: json.title,
 		width: width,
 		height: height,
+		resizable: false,
+		draggable: false,
 		modal: true,
 		close: closeDialog,
 		buttons: {"Ok": function() {