diff options
Diffstat (limited to 'phpBB/assets/javascript')
-rw-r--r-- | phpBB/assets/javascript/core.js | 11 | ||||
-rw-r--r-- | phpBB/assets/javascript/editor.js | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 228230ff71..f7ace80705 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -1029,7 +1029,7 @@ phpbb.resizeTextArea = function($items, options) { function autoResize(item) { function setHeight(height) { - height += parseInt($item.css('height'), 10) - $item.height(); + height += parseInt($item.css('height'), 10) - $item.innerHeight(); $item .css({ height: height + 'px', resize: 'none' }) .addClass('auto-resized'); @@ -1048,7 +1048,7 @@ phpbb.resizeTextArea = function($items, options) { configuration.maxHeight ), $item = $(item), - height = parseInt($item.height(), 10), + height = parseInt($item.innerHeight(), 10), scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0; if (height < 0) { @@ -1538,6 +1538,13 @@ phpbb.toggleSelectSettings = function(el) { var $this = $(this), $setting = $($this.data('toggle-setting')); $setting.toggle($this.is(':selected')); + + // Disable any input elements that are not visible right now + if ($this.is(':selected')) { + $($this.data('toggle-setting') + ' input').prop('disabled', false); + } else { + $($this.data('toggle-setting') + ' input').prop('disabled', true); + } }); }; diff --git a/phpBB/assets/javascript/editor.js b/phpBB/assets/javascript/editor.js index 298526ab1f..3abf5c84f4 100644 --- a/phpBB/assets/javascript/editor.js +++ b/phpBB/assets/javascript/editor.js @@ -358,6 +358,12 @@ function getCaretPosition(txtarea) { if ($('#attach-panel').length) { phpbb.showDragNDrop(textarea); } + + $('textarea').on('keydown', function (e) { + if (e.which === 13 && (e.metaKey || e.ctrlKey)) { + $(this).closest('form').submit(); + } + }); }); })(jQuery); |