diff options
Diffstat (limited to 'lib/scripts')
-rw-r--r-- | lib/scripts/linkwiz.js | 10 | ||||
-rw-r--r-- | lib/scripts/toolbar.js | 15 |
2 files changed, 22 insertions, 3 deletions
diff --git a/lib/scripts/linkwiz.js b/lib/scripts/linkwiz.js index e8191dbcb..bc850226f 100644 --- a/lib/scripts/linkwiz.js +++ b/lib/scripts/linkwiz.js @@ -244,9 +244,10 @@ var dw_linkwiz = { so += dw_linkwiz.val.open.length; link = dw_linkwiz.val.open+link; } + link += '|'; + so += 1; if(stxt) { - link += '|'+stxt; - so += 1; + link += stxt; } if(dw_linkwiz.val.close) { link += dw_linkwiz.val.close; @@ -299,6 +300,11 @@ var dw_linkwiz = { dw_linkwiz.$wiz.show(); dw_linkwiz.$entry.focus(); dw_linkwiz.autocomplete(); + + // Move the cursor to the end of the input + var temp = dw_linkwiz.$entry.val(); + dw_linkwiz.$entry.val(''); + dw_linkwiz.$entry.val(temp); }, /** diff --git a/lib/scripts/toolbar.js b/lib/scripts/toolbar.js index 1bb02b406..a5f831ade 100644 --- a/lib/scripts/toolbar.js +++ b/lib/scripts/toolbar.js @@ -243,7 +243,20 @@ function pickerToggle(pickerid,$btn){ } else { $picker.addClass('a11y').attr('aria-hidden', 'true'); } - $picker.offset({left: pos.left+3, top: pos.top+$btn[0].offsetHeight+3}); + var picker_left = pos.left + 3, + picker_width = $picker.width(), + window_width = jQuery(window).width(); + if (picker_width > 300) { + $picker.css("max-width", "300"); + picker_width = 300; + } + if ((picker_left + picker_width + 40) > window_width) { + picker_left = window_width - picker_width - 40; + } + if (picker_left < 0) { + picker_left = 0; + } + $picker.offset({left: picker_left, top: pos.top+$btn[0].offsetHeight+3}); } /** |