diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2010-02-03 13:56:04 -0800 | 
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-02-04 08:23:02 -0800 | 
| commit | 95b26db82c3f835f66cdb32aef13aa84a6a206e5 (patch) | |
| tree | a407d6eae6e31148b0916666544a53a417e16084 /modules/organize | |
| parent | aa4ed454737d45bf8140fd84f2eea2e04ed4a7d6 (diff) | |
1) Simplify the layout of the organize dialog content.
2) Use CSS to layout the thmbnail grid to the full dialog size.  Fixes ticker #848.
3) Separate css that can be themed into organize_theme.css.  This isolates the themed components into a separate file for easy of overriding by a theme.
Diffstat (limited to 'modules/organize')
| -rw-r--r-- | modules/organize/css/organize.css | 47 | ||||
| -rw-r--r-- | modules/organize/css/organize_theme.css | 10 | ||||
| -rw-r--r-- | modules/organize/helpers/organize_theme.php | 1 | ||||
| -rw-r--r-- | modules/organize/js/organize.js | 30 | ||||
| -rw-r--r-- | modules/organize/views/organize_dialog.html.php | 10 | ||||
| -rw-r--r-- | modules/organize/views/organize_thumb_grid.html.php | 12 | 
6 files changed, 60 insertions, 50 deletions
| diff --git a/modules/organize/css/organize.css b/modules/organize/css/organize.css index bc8e5b0c..ef1f856b 100644 --- a/modules/organize/css/organize.css +++ b/modules/organize/css/organize.css @@ -3,18 +3,18 @@   */  #g-organize { -  height: auto;    margin: 0 !important; +  min-height: auto;    padding: 0 !important;    position: relative;    width: 100%;  }  #g-organize-content-pane { -  height: auto; +  height: 100%;    margin: 0 !important;    padding: 0 !important; -  position: relative; +  position: absolute;    width: 100%;  } @@ -23,11 +23,15 @@   */  #g-organize #g-organize-tree-container { -  height: 100%; -  overflow: auto;    margin: 0; +  min-height: 100%;    padding: 0; -  width: 19%; +  position: relative; +  width: 20%; +} + +#g-organize #g-organize-tree-container h3 { +  margin-bottom: 0.1em;  }  #g-organize-album-tree { @@ -54,10 +58,10 @@   */  #g-organize #g-organize-detail { -  height: 100%;    margin: 0 !important; -  overflow: hidden; +  min-height: 100%;    padding: 0 !important; +  position: relative;    width: 80%;  } @@ -71,21 +75,17 @@    width: inherit;  } -#g-organize-microthumb-panel { -  height: 100%; -  margin: 0 !important; -  position: relative; -  padding: 0 !important; -  width: 100%; -} -  #g-organize-microthumb-grid { -  height: 100%; -  overflow: auto; +  bottom: 1.8em; +  left: 0; +  margin: 0 !important; +  overflow-x: hidden; +  overflow-y: auto;    padding: .4em !important; -  position: relative; +  position: absolute; +  right: 0; +  top: 1.6em;  } -  .g-organize-microthumb-grid-cell {    display: block;    height: 100px; @@ -112,8 +112,13 @@   */  #g-organize-controls { +  bottom: 0; +  height: 1.9em; +  left: 0;    margin: 0 !important; -  padding: .2em .4em; +  padding: .1em .4em; +  position: absolute; +  right: 0;  }  #g-organize-controls select { diff --git a/modules/organize/css/organize_theme.css b/modules/organize/css/organize_theme.css new file mode 100644 index 00000000..727dca97 --- /dev/null +++ b/modules/organize/css/organize_theme.css @@ -0,0 +1,10 @@ +/** ******************************************************************* + * Organize styles that are theme overrideable + *********************************************************************/ +.g-organize-microthumb-grid-cell.ui-selected { +  background: #DFEFFC !important; +} + +#g-organize-microthumb-grid { +  border: 1px solid #79B7E7; +} diff --git a/modules/organize/helpers/organize_theme.php b/modules/organize/helpers/organize_theme.php index 61b6fe7d..c2914675 100644 --- a/modules/organize/helpers/organize_theme.php +++ b/modules/organize/helpers/organize_theme.php @@ -27,6 +27,7 @@ class organize_theme {        // approach that lets us continue to use the Kohana cascading filesystem.        $theme->script("organize.js");        $theme->css("organize.css"); +      $theme->css("organize_theme.css");      }    }  } diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js index 76eadf85..a89305f6 100644 --- a/modules/organize/js/organize.js +++ b/modules/organize/js/organize.js @@ -4,15 +4,15 @@        handle: ".ui-selected",        distance: 10,        cursorAt: { left: -10, top: -10}, -      appendTo: "#g-organize-microthumb-panel", +      appendTo: "#g-organize",        helper: function(event, ui) {          var selected = $(".ui-draggable.ui-selected img");          if (selected.length) {            var set = $('<div class="g-drag-helper"></div>')  		      .css({ -            zIndex: 2000, -            width: 80, -            height: Math.ceil(selected.length / 5) * 16 +                        zIndex: 2000, +                        width: 80, +                        height: Math.ceil(selected.length / 5) * 16  		      });            var offset = $(this).offset();            var click = {left: event.pageX - offset.left, top: event.pageY - offset.top}; @@ -37,16 +37,16 @@        },        start: function(event, ui) { -        $("#g-organize-microthumb-panel .ui-selected").hide(); +        $("#g-organize-microthumb-grid .ui-selected").hide();        },        drag: function(event, ui) { -        var top = $("#g-organize-microthumb-panel").offset().top; -        var height = $("#g-organize-microthumb-panel").height(); +        var top = $("#g-organize-microthumb-grid").offset().top; +        var height = $("#g-organize-microthumb-grid").height();          if (ui.offset.top > height + top - 20) { -          $("#g-organize-microthumb-panel").get(0).scrollTop += 100; +          $("#g-organize-microthumb-grid").get(0).scrollTop += 100;          } else if (ui.offset.top < top + 20) { -          $("#g-organize-microthumb-panel").get(0).scrollTop = Math.max(0, $("#g-organize-microthumb-panel").get(0).scrollTop - 100); +          $("#g-organize-microthumb-grid").get(0).scrollTop = Math.max(0, $("#g-organize-microthumb-grid").get(0).scrollTop - 100);          }        }      }, @@ -63,7 +63,7 @@            target_id = $(".currentDropTarget").attr("ref");          } else {            before_or_after = "after"; -          target_id = $("#g-organize-microthumb-grid li:last").attr("ref"); +          target_id = $("#g-organize-microthumb-grid div:last").attr("ref");          }          $.organize.do_drop({            url: rearrange_url @@ -92,7 +92,7 @@      },      do_drop: function(options) { -      $("#g-organize-microthumb-panel").selectable("destroy"); +      $("#g-organize-microthumb-grid").selectable("destroy");        var source_ids = [];        $(options.source).each(function(i) {          source_ids.push($(this).attr("ref")); @@ -102,7 +102,7 @@          $.post(options.url,  	        { "source_ids[]": source_ids },  	        function(data) { -            $.organize._refresh(data); +                  $.organize._refresh(data);  	        },  	      "json");        } @@ -141,8 +141,6 @@        $("#g-dialog").dialog("option", "zIndex", 70);        $("#g-dialog").bind("dialogopen", function(event, ui) {          $("#g-organize").height($("#g-dialog").innerHeight() - 20); -        $("#g-organize-microthumb-grid").height($("#g-dialog").innerHeight() - 91); -        $("#g-organize-tree-container").height($("#g-dialog").innerHeight() - 60);        });        $("#g-dialog").bind("dialogclose", function(event, ui) { @@ -210,11 +208,11 @@        if ($(parent).hasClass("g-view-only")) {          return;        } -      $("#g-organize-microthumb-panel").selectable("destroy"); +      $("#g-organize-microthumb-grid").selectable("destroy");        var id = $(event.currentTarget).attr("ref");        $(".g-organize-album-text.ui-state-focus").removeClass("ui-state-focus");        $(".g-organize-album-text[ref=" + id + "]").addClass("ui-state-focus"); -      var url = $("#g-organize-microthumb-panel").attr("ref").replace("__ITEM_ID__", id).replace("__OFFSET__", 0); +      var url = $("#g-organize-microthumb-grid").attr("ref").replace("__ITEM_ID__", id).replace("__OFFSET__", 0);        $.get(url, {},          function(data) {            $("#g-organize-microthumb-grid").html(data.grid); diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 435f5ae3..3d824886 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -15,14 +15,12 @@        </ul>      </div>      <div id="g-organize-detail" class="g-left ui-helper-clearfix"> -      <div id="g-organize-microthumb-panel" class="ui-widget" +      <ul id="g-action-status" class="g-message-block"> +        <li class="g-info"><?= t("Drag and drop photos to re-order or move between albums") ?></li> +      </ul> +      <div id="g-organize-microthumb-grid" class="ui-widget"             ref="<?= url::site("organize/album/__ITEM_ID__/__OFFSET__") ?>"> -        <ul id="g-action-status" class="g-message-block"> -          <li class="g-info"><?= t("Drag and drop photos to re-order or move between albums") ?></li> -        </ul> -        <ul id="g-organize-microthumb-grid" class="ui-widget-content">            <?= $micro_thumb_grid ?> -        </ul>        </div>        <div id="g-organize-controls" class="ui-widget-header">          <a id="g-organize-close" href="#" ref="done" diff --git a/modules/organize/views/organize_thumb_grid.html.php b/modules/organize/views/organize_thumb_grid.html.php index f29680f7..f5db53d4 100644 --- a/modules/organize/views/organize_thumb_grid.html.php +++ b/modules/organize/views/organize_thumb_grid.html.php @@ -1,12 +1,10 @@  <?php defined("SYSPATH") or die("No direct script access.") ?>  <? foreach ($album->children(25, $offset) as $child): ?> -<li class="g-organize-microthumb-grid-cell g-left ui-state-default ui-state-active" ref="<?= $child->id ?>"> -  <!-- div id="g-organize-microthumb-<?= $child->id ?>" -       class="g-organize-microthumb <?= $child->is_album() ? "g-album" : "g-photo" ?> ui-state-active" --> -    <?= $child->thumb_img(array("class" => "g-thumbnail", "ref" => $child->id), 90, true) ?> -    <span<?= $child->is_album() ? " class=\"ui-icon ui-icon-note\"" : "" ?>></span> -  <!-- /div --> -</li> +<div class="g-organize-microthumb-grid-cell g-left ui-state-default ui-state-active <?= $child->is_album() ? "g-album" : "g-photo" ?>" +    ref="<?= $child->id ?>"> +  <?= $child->thumb_img(array("class" => "g-thumbnail", "ref" => $child->id), 90, true) ?> +  <span<?= $child->is_album() ? " class=\"ui-icon ui-icon-note\"" : "" ?>></span> +</div>  <? endforeach ?>  <? if ($album->children_count() > $offset): ?> | 
