cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [10/50] [abbrv] git commit: updated refs/heads/ui-restyle to 500c798
Date Thu, 24 Oct 2013 18:30:48 GMT
CLOUDSTACK-4931: Instance wizard: use fn to hide/show template root size


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

Branch: refs/heads/ui-restyle
Commit: 1f0dd7cc369e4ebbe45d398e2249dd129d91b526
Parents: 69b131f
Author: Brian Federle <brian.federle@citrix.com>
Authored: Wed Oct 23 09:58:38 2013 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Wed Oct 23 09:58:38 2013 -0700

----------------------------------------------------------------------
 ui/scripts/instanceWizard.js           |  4 +-
 ui/scripts/ui-custom/instanceWizard.js | 76 +++++------------------------
 2 files changed, 15 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f0dd7cc/ui/scripts/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js
index 2d6d66b..40832ae 100644
--- a/ui/scripts/instanceWizard.js
+++ b/ui/scripts/instanceWizard.js
@@ -238,7 +238,9 @@
                         templates: templatesObj,
                         hypervisors: hypervisorObjs
                     },
-                    customFlag: 'isdynamicallyscalable', // Field determines if custom slider
is shown
+                    customHidden: function(args) {
+                        return true;
+                    }
                 });
             },
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f0dd7cc/ui/scripts/ui-custom/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js
index c6d6201..a246051 100644
--- a/ui/scripts/ui-custom/instanceWizard.js
+++ b/ui/scripts/ui-custom/instanceWizard.js
@@ -383,72 +383,20 @@
 
                                     originalValues(formData);
 
-                                    $step.find('input[type=radio]').bind('change', function()
{
-                                        var $target = $(this);
-                                        var val = $target.val();
-                                        var item;
-
-                                        $.map(args.data.templates, function(v, k) {
-                                            if (!v) {
-                                                return true;
-                                            }
-                                            
-                                            var target = $.grep(v, function(elem) {
-                                                return elem.id == val;
-                                            });
-
-                                            if (target.length) {
-                                                item = target[0];
-
-                                                return false;
-                                            }
-
-                                            return true;
-                                        });
-
-                                        if (!item) return true;
-
-                                        var custom = item[args.customFlag];
-
-                                        $step.find('.custom-size-label').remove();
-
-                                        if (custom) {
-                                            $target.parent().find('.name')
-                                                .append(
-                                                    $('<span>').addClass('custom-size-label')
-                                                        .append(': ')
-                                                        .append(
-                                                            $('<span>').addClass('custom-disk-size').html(
-                                                                $step.find('.custom-size
input[name=size]').val()
-                                                            )
-                                                        )
-                                                        .append(' GB')
-                                                );
-                                            $target.parent().find('.select-desc .desc')
-                                                .append(
-                                                    $('<span>').addClass('custom-size-label')
-                                                        .append(', ')
-                                                        .append(
-                                                            $('<span>').addClass('custom-disk-size').html(
-                                                                $step.find('.custom-size
input[name=size]').val()
-                                                            )
-                                                        )
-                                                        .append(' GB')
-                                                );
-                                            $step.find('.section.custom-size').show();
-                                            $step.addClass('custom-disk-size');
-                                            $target.closest('.select-container').scrollTop(
-                                                $target.position().top
-                                            );
-                                        } else {
-                                            $step.find('.section.custom-size').hide();
-                                            $step.removeClass('custom-disk-size');
-                                        }
-
-                                        return true;
+                                    var custom = args.customHidden({
+                                        context: context,
+                                        data: args.data
                                     });
 
-                                    $step.find('input[type=radio]:first').trigger('change');
+                                    $step.find('.custom-size-label').remove();
+
+                                    if (!custom) {
+                                        $step.find('.section.custom-size').show();
+                                        $step.addClass('custom-disk-size');
+                                    } else {
+                                        $step.find('.section.custom-size').hide();
+                                        $step.removeClass('custom-disk-size');
+                                    }
                                 }
                             }
                         };


Mime
View raw message