On Mon, 2010-10-18 at 20:00 +0200, Jakub Steiner wrote:
> ---
>  src/app/stylesheets/aggregator.scss             |   12 +++-
>  src/app/views/templates/_content_selection.haml |    3 +-
>  src/app/views/templates/new.haml                |   15 +++++
>  src/public/images/icons/expander-collapsed.png  |  Bin 0 -> 239 bytes
>  src/public/images/icons/expander-collapsed.svg  |   74 
> +++++++++++++++++++++++
>  src/public/images/icons/expander-expanded.png   |  Bin 0 -> 240 bytes
>  src/public/images/icons/expander-expanded.svg   |   74 
> +++++++++++++++++++++++
>  7 files changed, 174 insertions(+), 4 deletions(-)
>  create mode 100644 src/public/images/icons/expander-collapsed.png
>  create mode 100644 src/public/images/icons/expander-collapsed.svg
>  create mode 100644 src/public/images/icons/expander-expanded.png
>  create mode 100644 src/public/images/icons/expander-expanded.svg
> 
> diff --git a/src/app/stylesheets/aggregator.scss 
> b/src/app/stylesheets/aggregator.scss
> index 6711ee6..616581b 100644
> --- a/src/app/stylesheets/aggregator.scss
> +++ b/src/app/stylesheets/aggregator.scss
> @@ -1127,14 +1127,20 @@ a.iconbutton {
>    height: 600px;
>    overflow: auto;
>    display: block;
> -  @include column-count(4);
>    &>li {
>      display: block;
>      text-transform: uppercase;
> -    margin: 0 0 2em 0; padding: 0;
> -    @include column-break-before(always);
> +    margin: 0 0 2em 0; padding: 0 0 0 20px;
> +    background: url('../../images/icons/expander-collapsed.png') no-repeat 0 
> 0;
> +    &.expanded {
> +      background: url('../../images/icons/expander-expanded.png') no-repeat 
> 0 0;
> +    }
> +    label {
> +      cursor: pointer;
> +    }
>    }
>    .packages {
> +    @include column-count(4);
>      display: block;
>      margin: 1em 0 0 0;
>      &:first-child {
> diff --git a/src/app/views/templates/_content_selection.haml 
> b/src/app/views/templates/_content_selection.haml
> index 2372a4a..1acccbd 100644
> --- a/src/app/views/templates/_content_selection.haml
> +++ b/src/app/views/templates/_content_selection.haml
> @@ -36,7 +36,8 @@
>          - group_id = group.gsub(/\s/, '_')
>          %li
>            = check_box_tag 'groups[]', group, group_sel, :disabled => 
> group_sel, :id => "group_#{group_id}"
> -          = label_tag "group_#{group_id}", group
> +          %label.disclosure
> +            =group
>            %ul{:class => "packages group_#{group_id}"}
>              - pkgs = @groups[group][:packages]
>              - pkgs.keys.sort.each do |pkg|
> diff --git a/src/app/views/templates/new.haml 
> b/src/app/views/templates/new.haml
> index 42fc85d..c502ecc 100644
> --- a/src/app/views/templates/new.haml
> +++ b/src/app/views/templates/new.haml
> @@ -10,6 +10,7 @@
>        $(this).hide();
>        $container.empty().show().addClass('loading');
>        $container.load(show_all ? list_all_url : list_url, list_data, 
> function() {
> +        var $groups = $('.softwaregroups .disclosure', this);
>          $container.removeClass('loading');
>          $('#do_add_software').click(function(e) {
>            var url = '#{url_for :action => 'add_software', :ajax => true, 
> :add_selected => true}';
> @@ -34,6 +35,7 @@
>            $container.hide();
>            $submit.show();
>          });
> +        //select all packages in group
>          $(".softwaregroups input[type='checkbox']").click(function() {
>            if ($(this).attr("checked") === true) {
>              
> $(this).siblings("ul").find("input[type='checkbox']").attr("checked","checked");
> @@ -41,6 +43,19 @@
>              
> $(this).siblings("ul").find("input[type='checkbox']").removeAttr("checked");
>            }
>          });
> +        //disclosure triangles
> +        $(".packages").hide();
> +        $groups.click(function() {
> +          var $packages = $(this).siblings('.packages');
> +          var $container = $(this).parent('li');
> +          if ($packages.filter(':visible').length) {
> +            $packages.hide(200);
> +            $container.removeClass('expanded');
> +          } else {
> +            $packages.show(200);
> +            $container.addClass('expanded');
> +          }
ACK, I'll push this momentarily, though I made a small optimization to
the js, removing the above if/else block and replacing with:
  $packages.toggle(200);
  $container.toggleClass('expanded');
> +        });
>        });
>      });
>    });


_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to