Browse Source

[SCEditor] better apply the overflow auto only to the smiley container and not to the "titlebar" and the "close button" too

Signed-off-by: emanuele <[email protected]>
emanuele 12 năm trước cách đây
mục cha
commit
915591f404
1 tập tin đã thay đổi với 13 bổ sung8 xóa
  1. 13 8
      Themes/default/scripts/jquery.sceditor.js

+ 13 - 8
Themes/default/scripts/jquery.sceditor.js

@@ -3485,13 +3485,15 @@
 							var emoticons = $.extend({}, base.options.emoticons.popup);
 							var popup_position;
 							var titlebar = $('<div class="catbg sceditor-popup-grip"/>');
-								popupContent = $('<div id="sceditor-popup"/>');
-								allowHide = true;
-								popupContent.append(titlebar);
-								line = $('<div />');
-								closeButton = $('<span />').text('[' + base._('Close') + ']').click(function () {
-									$(".sceditor-smileyPopup").fadeOut('fast');
-								});
+							popupContent = $('<div id="sceditor-popup"/>');
+							allowHide = true;
+							line = $('<div id="sceditor-popup-smiley"/>');
+							adjheight = 0;
+
+							popupContent.append(titlebar);
+							closeButton = $('<span />').text('[' + base._('Close') + ']').click(function () {
+								$(".sceditor-smileyPopup").fadeOut('fast');
+							});
 
 							$.each(emoticons, base.appendEmoticon);
 
@@ -3511,12 +3513,15 @@
 
 							$dropdown.appendTo($('body'));
 							dropdownIgnoreLastClick = true;
+							adjheight = closeButton.height() + titlebar.height();
 							$dropdown.css({
 								position: "fixed",
 								top: $(window).height() * 0.2,
-								left: $(window).width() * 0.5 - ($dropdown.width() / 2),
+								left: $(window).width() * 0.5 - ($dropdown.find('#sceditor-popup-smiley').width() / 2),
 								"max-width": "50%",
 								"max-height": "50%",
+							}).find('#sceditor-popup-smiley').css({
+								height: $dropdown.height() - adjheight,
 								"overflow": "auto"
 							});