Changeset 11610 for branches

Show
Ignore:
Timestamp:
11/10/08 16:09:42 (8 weeks ago)
Author:
iclerencia@…
Message:

Allow widgets to be deleted

Location:
branches/iclerencia/dashboard/client/ebox/src/templates/dashboard
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/iclerencia/dashboard/client/ebox/src/templates/dashboard/configurewidgets.mas

    r11602 r11610  
    3737        for (j = 0; j < widgets.length; ++j) { 
    3838            var name = "widget_" + module + ":" + widgets[j]["name"]; 
     39            //recalculate present because it can have changed 
     40            widgets[j]["present"] = $(name) && ($(name).parentNode.id.indexOf("dashboard") == 0); 
    3941            widget_name_list[j] = name + "_placeholder"; 
    4042            str = str + "<div style='display: block;' class='widgetBox' id='" + name + "_placeholder'>" + widgets[j]["title"]; 
     
    8082                func = function(dashboard) { 
    8183                    var id = dashboard.id; 
    82                     alert(id); 
    8384                    new Ajax.Request("/ebox/Dashboard/Update", { 
    8485                        method: "post", 
  • branches/iclerencia/dashboard/client/ebox/src/templates/dashboard/index.mas

    r11594 r11610  
    1414<script type="text/javascript" src="/data/js/table-helper.js">//</script> 
    1515<script type="text/javascript"> 
    16  
    1716function toggleClose() 
    1817{ 
     
    6261<script type="text/javascript"> 
    6362//<![CDATA[ 
     63function closeWidget(widget) 
     64{ 
     65    var name = 'widget_' + widget; 
     66    var parent = $(name).parentNode.id; 
     67    Element.remove(name); 
     68    new Ajax.Request("/ebox/Dashboard/Update", { 
     69        method: "post", 
     70        parameters: { dashboard: parent, widgets: Sortable.sequence(parent).join(',') } 
     71    }); 
     72} 
     73 
    6474function toggleClicked(element) { 
    6575    var togglername = element + '_toggler'; 
  • branches/iclerencia/dashboard/client/ebox/src/templates/dashboard/widget.mas

    r11594 r11610  
    44</%args> 
    55<%init> 
    6 my $content = ($widget->{name} . '_content'); 
     6my $fqmn = $widget->{module} . ':' . $widget->{name}; 
     7my $content = ($fqmn . '_content'); 
    78</%init> 
    8 <div class='widgetBox' id='widget_<% $widget->{module} %>:<% $widget->{name} %>'> 
     9<div class='widgetBox' id='widget_<% $fqmn %>'> 
    910    <div class='widgetTopBar'> 
    1011% my $togglerClass = 'minBox'; 
     
    1213%    $togglerClass = 'maxBox'; 
    1314% } 
    14         <a id='<% $content %>_closer' class='closeBox' href='#' onclick="close('<% $content %>');" style='display: none;'><span class='hidden'>Close</span></a> 
     15        <a id='<% $content %>_closer' class='closeBox' href='#' onclick="closeWidget('<% $fqmn %>');" style='display: none;'><span class='hidden'>Close</span></a> 
    1516        <div class='widgetTopBackground'></div> 
    1617        <div class='widgetHandle'></div> 
     
    2425> 
    2526% foreach my $section (@{$widget->sections()}) { 
    26                 <& /dashboard/section.mas, namespace => $widget->{name}, section => $section, toggled => \%toggled &> 
     27                <& /dashboard/section.mas, namespace => $fqmn, section => $section, toggled => \%toggled &> 
    2728% } 
    2829    </div>