summaryrefslogtreecommitdiff
path: root/lib/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scripts')
-rw-r--r--lib/scripts/media.js11
-rw-r--r--lib/scripts/page.js11
2 files changed, 15 insertions, 7 deletions
diff --git a/lib/scripts/media.js b/lib/scripts/media.js
index 1872f2c61..182d5fefe 100644
--- a/lib/scripts/media.js
+++ b/lib/scripts/media.js
@@ -31,6 +31,7 @@ var dw_mediamanager = {
var $content, $tree;
$content = jQuery('#media__content');
$tree = jQuery('#media__tree');
+ if(!$tree.length) return;
dw_mediamanager.prepare_content($content);
@@ -434,7 +435,7 @@ var dw_mediamanager = {
dw_mediamanager.$resizables().resizable('destroy');
if (update_list) {
- dw_mediamanager.list.call(jQuery('input[value="Apply"]')[0]);
+ dw_mediamanager.list.call(jQuery('#mediamanager__page form.options input[type="submit"]')[0]);
}
$content.html(data);
@@ -494,12 +495,12 @@ var dw_mediamanager = {
// set max width of resizable column
var widthOtherResizable = widthResizables - jQuery(this).width();
var minWidthNonResizable = parseFloat($filePanel.css("min-width"));
- var maxWidth = widthFull - (widthOtherResizable + minWidthNonResizable);
+ var maxWidth = widthFull - (widthOtherResizable + minWidthNonResizable) - 1;
$resizables.resizable( "option", "maxWidth", maxWidth );
// width of file panel in % = 100% - width of resizables in %
- // this calculates with 99.99 and not 100 to overcome rounding errors
- var relWidthNonResizable = 99.99 - (100 * widthResizables / widthFull);
+ // this calculates with 99.9 and not 100 to overcome rounding errors
+ var relWidthNonResizable = 99.9 - (100 * widthResizables / widthFull);
// set width of file panel
$filePanel.width(relWidthNonResizable+'%');
@@ -513,6 +514,8 @@ var dw_mediamanager = {
});
}
+ dw_mediamanager.resize();
+
dw_mediamanager.opacity_slider();
dw_mediamanager.portions_slider();
}
diff --git a/lib/scripts/page.js b/lib/scripts/page.js
index 5ac81f33b..b8e83cb0c 100644
--- a/lib/scripts/page.js
+++ b/lib/scripts/page.js
@@ -27,9 +27,14 @@ dw_page = {
// Walk the DOM tree up (first previous siblings, then parents)
// until boundary element
while($tgt.length > 0 && !$tgt.hasClass('sectionedit' + nr)) {
- // $.last gives the DOM-ordered last element:
- // prev if present, else parent.
- $tgt = $tgt.prev().add($tgt.parent()).last();
+ // go down when the sectionedit begin marker is below $tgt
+ if ($tgt.find('.sectionedit' + nr).length > 0) {
+ $tgt = $tgt.children().last();
+ } else {
+ // $.last gives the DOM-ordered last element:
+ // prev if present, else parent.
+ $tgt = $tgt.prev().add($tgt.parent()).last();
+ }
$tgt.addClass('section_highlight');
}
})