cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [2/2] git commit: updated refs/heads/wip-multi-disk-select to f23dd1d
Date Wed, 02 Apr 2014 20:55:23 GMT
WIP


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f23dd1df
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f23dd1df
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f23dd1df

Branch: refs/heads/wip-multi-disk-select
Commit: f23dd1df9ef405c507f725bf995871d436da6c3c
Parents: 1120b38
Author: Brian Federle <brian.federle@citrix.com>
Authored: Wed Apr 2 13:20:35 2014 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Wed Apr 2 13:20:35 2014 -0700

----------------------------------------------------------------------
 ui/css/cloudstack3.css                 |  4 ++
 ui/index.jsp                           |  2 +-
 ui/scripts/ui-custom/instanceWizard.js | 58 ++++++++++++++++++-----------
 3 files changed, 42 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f23dd1df/ui/css/cloudstack3.css
----------------------------------------------------------------------
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index 0743bb1..6602c16 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -6126,6 +6126,10 @@ label.error {
   height: 0;
 }
 
+.multi-wizard.instance-wizard .data-disk-offering .disk-select-group.custom-size .section.custom-size
{
+  display: block !important;
+}
+
 .multi-wizard.instance-wizard .data-disk-offering .disk-select-group .select input {
   margin: 13px 12px 12px;
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f23dd1df/ui/index.jsp
----------------------------------------------------------------------
diff --git a/ui/index.jsp b/ui/index.jsp
index 4910b9f..5840e71 100644
--- a/ui/index.jsp
+++ b/ui/index.jsp
@@ -250,7 +250,7 @@
                                 </div>
 
                                 <!-- Custom size slider -->
-                                <div class="section custom-size">
+                                <div class="section custom-size custom-disk-size">
                                     <label><fmt:message key="label.disk.size"/></label>
 
                                     <!-- Slider -->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f23dd1df/ui/scripts/ui-custom/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js
index 1d325e4..0174cfc 100644
--- a/ui/scripts/ui-custom/instanceWizard.js
+++ b/ui/scripts/ui-custom/instanceWizard.js
@@ -506,7 +506,7 @@
 
                                     var $selectContainer = $step.find('.content .select-container:not(.multi-disk)');
 
-                                    if (multiDisk) {
+                                    if (multiDisk) { // Render as multiple groups for each
disk
                                         var $multiDiskSelect = $('<div>').addClass('multi-disk-select-container');
 
                                         $(multiDisk).map(function(index, disk) {
@@ -522,16 +522,17 @@
                                             .prependTo($header);
                                             var $multiSelectContainer = $selectContainer.clone().append(
                                                 makeSelects('diskofferingid.' + disk.id,
args.data.diskOfferings, {
-                                                id: 'id',
-                                                name: 'name',
-                                                desc: 'displaytext'
-                                            }, {
-                                                'wizard-field': 'disk-offering'
-                                            })
+                                                    id: 'id',
+                                                    name: 'name',
+                                                    desc: 'displaytext'
+                                                }, {
+                                                    'wizard-field': 'disk-offering'
+                                                })
                                             ).appendTo($group).addClass('multi-disk');
 
                                             $group.appendTo($multiDiskSelect);
 
+                                            // Show-hide disk group selects
                                             $checkbox.click(function() {
                                                 $group.toggleClass('selected');
                                                 $group.find('.select:first input[type=radio]').click();
@@ -542,7 +543,11 @@
                                                     $step.find('.no-thanks input[type=radio]').attr('checked',
false);
                                                 }
                                             });
+
+                                            // Add custom disk size box
+                                            $step.find('.section.custom-size').clone().hide().appendTo($group);
                                         });
+
                                         $multiDiskSelect.insertAfter($selectContainer);
                                         $selectContainer.hide();
 
@@ -567,10 +572,10 @@
                                         var item = $.grep(args.data.diskOfferings, function(elem)
{
                                             return elem.id == val;
                                         })[0];
+                                        var isMultiDisk = $step.find('.multi-disk-select').size();
 
                                         // Uncheck any multi-select groups
-                                        if ($target.closest('.no-thanks').size() &&
-                                            $step.find('.multi-disk-select').size()) {
+                                        if ($target.closest('.no-thanks').size() &&
isMultiDisk) {
                                             $step.find('.disk-select-group input[type=checkbox]:checked').click();
                                             $(this).attr('checked', true);
 
@@ -578,21 +583,26 @@
                                         }
 
                                         if (!item) {
-                                            // handle removal of custom size controls
-                                            $step.find('.section.custom-size').hide();
-                                            $step.removeClass('custom-disk-size');
-
-                                            // handle removal of custom IOPS controls
-                                            $step.removeClass('custom-iops-do');
-
+                                            if (isMultiDisk) {
+                                                $(this).closest('.disk-select-group .section.custom-size').hide();
+                                                $(this).closest('.disk-select-group').removeClass('custom-size');
+                                            } else {
+                                                // handle removal of custom size controls
+                                                $step.find('.section.custom-size').hide();
+                                                $step.removeClass('custom-disk-size');
+
+                                                // handle removal of custom IOPS controls
+                                                $step.removeClass('custom-iops-do');
+                                            }
+                                            
                                             return true;
                                         }
 
                                         var custom = item[args.customFlag];
 
-                                        $step.find('.custom-size-label').remove();
+                                        if (!isMultiDisk) $step.find('.custom-size-label').remove();
 
-                                        if (custom) {
+                                        if (custom && !isMultiDisk) {
                                             $target.parent().find('.name')
                                             .append(
                                                 $('<span>').addClass('custom-size-label')
@@ -620,9 +630,15 @@
                                             $target.closest('.select-container').scrollTop(
                                                 $target.position().top
                                             );
+                                        } else if (custom && isMultiDisk) {
+                                            $(this).closest('.disk-select-group').addClass('custom-size');
                                         } else {
-                                            $step.find('.section.custom-size').hide();
-                                            $step.removeClass('custom-disk-size');
+                                            if (isMultiDisk) {
+                                                $(this).closest('.disk-select-group').removeClass('custom-size');
+                                            } else {
+                                                $step.find('.section.custom-size').hide();
+                                                $step.removeClass('custom-disk-size');
+                                            }
                                         }
 
                                         var customIops = item[args.customIopsDoFlag];
@@ -1178,7 +1194,7 @@
                 $wizard.find('.tab-view').tabs();
                 $wizard.find('.slider').each(function() {
                    var $slider = $(this);
-
+                   
                     $slider.slider({
                         min: minCustomDiskSize,
                         max: maxCustomDiskSize,


Mime
View raw message