이모티콘 컴포넌트 리사이징 개선 PR

이모티콘에 따라 팝업 윈도우 사이즈를 바꾸면서 이모티콘을 적절하게 표시합니다.
This commit is contained in:
MinSoo Kim 2015-07-14 00:59:09 +09:00
parent 6745497ad7
commit 6da2493b77
3 changed files with 16 additions and 2 deletions

View file

@ -11,5 +11,5 @@
</select>
</div>
</div>
<div id="emoticons" style="height:1px"></div>
<div id="emoticons" style="min-height:1px"></div>
</section>

View file

@ -22,7 +22,20 @@ function completeGetEmoticons(ret_obj) {
for(var i=0;i<emoticons.length;i++) {
html[html.length] = '<img src="./modules/editor/components/emoticon/tpl/images/'+emoticons[i]+'" class="emoticon" />';
}
jQuery('#emoticons').html(html.join('')).find('img.emoticon').click(insertEmoticon);
jQuery('#emoticons').html(html.join('')).find('img.emoticon')
.click(insertEmoticon)
.load(function(){
/* resize popup window for new emoticons loaded, 2015-07-14 by misol */
if(jQuery('section.section').outerHeight(true) != jQuery( window ).height())
{
// more space for y-scroll
var ww = (jQuery('section.section').outerHeight(true) > jQuery( window ).height())? jQuery('section.section').outerWidth(true) + 60 : jQuery('section.section').outerWidth(true) + 30;
// not more than screen height
var wh = (screen.height-100 < jQuery('section.section').outerHeight(true)+100)? screen.height-100 : jQuery('section.section').outerHeight(true)+100;
window.resizeTo(ww, wh);
}
});
}
/**

View file

@ -0,0 +1 @@
jQuery(function(e){function o(e){var o={component:"emoticon",emoticon:e,method:"getEmoticonList"},t="error message emoticons".split(" ");exec_xml("editor","procEditorCall",o,i,t)}function i(e){for(var o=e.emoticons.split("\n"),i=[],n=0;n<o.length;n++)i[i.length]='<img src="./modules/editor/components/emoticon/tpl/images/'+o[n]+'" class="emoticon" />';jQuery("#emoticons").html(i.join("")).find("img.emoticon").click(t).load(function(){if(jQuery("section.section").outerHeight(!0)!=jQuery(window).height()){var e=jQuery("section.section").outerHeight(!0)>jQuery(window).height()?jQuery("section.section").outerWidth(!0)+60:jQuery("section.section").outerWidth(!0)+30,o=screen.height-100<jQuery("section.section").outerHeight(!0)+100?screen.height-100:jQuery("section.section").outerHeight(!0)+100;window.resizeTo(e,o)}})}function t(){var e,o=n?opener:window;if(o)return e='<img src="'+this.src+'" class="emoticon" />',o.editorFocus(o.editorPrevSrl),o.editorRelKeys[o.editorPrevSrl].pasteHTML(e),n&&window.focus(),!1}var n=window._isPoped;o("msn"),e("#selectEmoticonList").change(function(){o(this.value)})});