Commit 2322130c authored by ricardo-teixeira's avatar ricardo-teixeira

Changed messageDiv id to messageDiv class to avoid errors when using multiple instances

parent 2d614e1e
{
"name": "angular-emoji-popup",
"version": "1.1.0",
"homepage": "https://github.com/Coraza/angular-emoji-popup",
"description": "Angular based Emoji Popup along with filters for encoding/decoding emojis",
"main": [
"dist/js/config.js",
"dist/js/emoji.min.js",
"dist/css/emoji.min.css"
],
"keywords": [
"angular",
"emoji"
],
"authors": [
"madhur"
],
"license": "MIT",
"_release": "1.1.0",
"_resolution": {
"type": "version",
"tag": "1.1.0",
"commit": "8190ee2c3d1cc2405639e6324250d171e4b1ab0d"
},
"_source": "https://github.com/Coraza/angular-emoji-popup.git",
"_target": "^1.1.0",
"_originalSource": "angular-emoji-popup",
"_direct": true
}
\ No newline at end of file
...@@ -47,7 +47,7 @@ angular.module("myApp", ['ngSanitize', 'emojiApp']); ...@@ -47,7 +47,7 @@ angular.module("myApp", ['ngSanitize', 'emojiApp']);
The module consists of following components: The module consists of following components:
* `emojiForm` - Enclose this directive with a `textarea` and a `button` named `emojibtn`. * `emojiForm` - Enclose this directive with a `textarea` and a `button` named `emojibtn`.
This directive adds a `contenteditable` `div` and hides the `textarea`. Anything typed into this `contenteditable` `div` is synced with the `textarea`. It also hooks up the button to show an Emoji popup. This directive adds a `contenteditable` `div` and hides the `textarea`. Anything typed into this `contebteditable` `div` is synced with the `textarea`. It also hooks up the button to show an Emoji popup.
```html ```html
<div emoji-form emoji-message="emojiMessage"> <div emoji-form emoji-message="emojiMessage">
......
...@@ -107,19 +107,12 @@ opacity: 1; ...@@ -107,19 +107,12 @@ opacity: 1;
.emoji-menu { .emoji-menu {
position: absolute; position: absolute;
z-index: 999; z-index: 999;
width: 225px; width: 275px;
margin-left: -107px; margin-left: -25px;
margin-top: -252px; margin-top: -264px;
overflow: hidden; overflow: hidden;
border-top: 1px #dfdfdf solid;
border: 1px #dfdfdf solid; border-bottom: 1px #dfdfdf solid;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
overflow: hidden;
-webkit-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1);
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1);
} }
.emoji-items-wrap1 { .emoji-items-wrap1 {
background: #FFF; background: #FFF;
...@@ -134,6 +127,8 @@ opacity: 1; ...@@ -134,6 +127,8 @@ opacity: 1;
text-align: center; text-align: center;
color: white; color: white;
line-height: 0; line-height: 0;
padding: 0px 4px;
border-color: #C1C1C1;
} }
.emoji-menu-tabs .emoji-menu-tab { .emoji-menu-tabs .emoji-menu-tab {
display: inline-block; display: inline-block;
...@@ -185,7 +180,7 @@ opacity: 1; ...@@ -185,7 +180,7 @@ opacity: 1;
height: 174px; height: 174px;
} }
.emoji-menu .emoji-items { .emoji-menu .emoji-items {
padding-right: 8px; /*padding-right: 8px;*/
outline: 0 !important; outline: 0 !important;
} }
.emoji-menu img { .emoji-menu img {
......
...@@ -29,7 +29,7 @@ emojiApp.config(['$sceProvider', function($sceProvider) ...@@ -29,7 +29,7 @@ emojiApp.config(['$sceProvider', function($sceProvider)
} }
} }
$.emojiarea.spritesheetPath = 'img/emojisprite_!.png'; $.emojiarea.spritesheetPath = '../assets/angular-emoji-popup/dist/img/emojisprite_!.png';
$.emojiarea.spritesheetDimens = Config.EmojiCategorySpritesheetDimens; $.emojiarea.spritesheetDimens = Config.EmojiCategorySpritesheetDimens;
$.emojiarea.iconSize = 20; $.emojiarea.iconSize = 20;
$.emojiarea.icons = icons; $.emojiarea.icons = icons;
......
...@@ -18,7 +18,6 @@ emojiApp.directive('emojiForm', ['$timeout', '$http', '$interpolate','$compile', ...@@ -18,7 +18,6 @@ emojiApp.directive('emojiForm', ['$timeout', '$http', '$interpolate','$compile',
var messageField = $('textarea', element)[0], var messageField = $('textarea', element)[0],
fileSelects = $('input', element), fileSelects = $('input', element),
emojiButton = $('#emojibtn', element)[0], emojiButton = $('#emojibtn', element)[0],
submitBtn = $('#submitBtn', element)[0],
editorElement = messageField, editorElement = messageField,
emojiArea = $(messageField).emojiarea( emojiArea = $(messageField).emojiarea(
{ {
...@@ -29,8 +28,8 @@ emojiApp.directive('emojiForm', ['$timeout', '$http', '$interpolate','$compile', ...@@ -29,8 +28,8 @@ emojiApp.directive('emojiForm', ['$timeout', '$http', '$interpolate','$compile',
richTextarea = $( richTextarea = $(
'.emoji-wysiwyg-editor', element)[0]; '.emoji-wysiwyg-editor', element)[0];
var s = $compile($("#messageDiv")); var s = $compile($(".messageDiv", element));
$("#messageDiv").replaceWith(s($scope)); $(".messageDiv", element).replaceWith(s($scope));
if (richTextarea) if (richTextarea)
...@@ -94,6 +93,8 @@ emojiApp.directive('emojiForm', ['$timeout', '$http', '$interpolate','$compile', ...@@ -94,6 +93,8 @@ emojiApp.directive('emojiForm', ['$timeout', '$http', '$interpolate','$compile',
$timeout.cancel(updatePromise); $timeout.cancel(updatePromise);
updateValue(); updateValue();
$scope.emojiMessage.replyToUser(); $scope.emojiMessage.replyToUser();
$scope.emojiMessage.messagetext = '';
$(richTextarea).empty();
// $(element).trigger('message_send'); // $(element).trigger('message_send');
resetTyping(); resetTyping();
return cancelEvent(e); return cancelEvent(e);
...@@ -127,7 +128,7 @@ emojiApp.directive('emojiForm', ['$timeout', '$http', '$interpolate','$compile', ...@@ -127,7 +128,7 @@ emojiApp.directive('emojiForm', ['$timeout', '$http', '$interpolate','$compile',
$scope.draftMessage.text || '').html(); $scope.draftMessage.text || '').html();
html = html.replace(/\n/g, '<br/>'); html = html.replace(/\n/g, '<br/>');
$(richTextarea).html(html); $(richTextarea).html(html);
var lastLength = html.length; //lastLength = html.length;
updateHeight(); updateHeight();
} }
} }
......
...@@ -276,7 +276,7 @@ ...@@ -276,7 +276,7 @@
+ xoffset + 'px ' + yoffset + 'px no-repeat;'; + xoffset + 'px ' + yoffset + 'px no-repeat;';
style += 'background-size:' + scaledWidth + 'px ' + scaledHeight style += 'background-size:' + scaledWidth + 'px ' + scaledHeight
+ 'px;'; + 'px;';
return '<img src="img/blank.gif" class="img" style="' return '<img src="../assets/angular-emoji-popup/dist/img/blank.gif" class="img" style="'
+ style + '" alt="' + util.htmlEntities(name) + '">'; + style + '" alt="' + util.htmlEntities(name) + '">';
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment