diff --git a/app/assets/javascripts/app/controllers/widget/organization.js.coffee b/app/assets/javascripts/app/controllers/widget/organization.js.coffee index 82a386080..a69d714fb 100644 --- a/app/assets/javascripts/app/controllers/widget/organization.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/organization.js.coffee @@ -41,16 +41,11 @@ class App.WidgetOrganization extends App.Controller organizationData: organizationData ) - a = => - visible = @el.find('textarea').is(":visible") - if visible && !@el.find('textarea').expanding('active') - @el.find('textarea').expanding() - @el.find('textarea').on('focus', (e) => - visible = @el.find('textarea').is(":visible") - if visible && !@el.find('textarea').expanding('active') - @el.find('textarea').expanding() - ) - @delay( a, 40 ) + @$('div [contenteditable]').ce( + mode: 'textonly' + multiline: true + maxlength: 250 + ) # enable user popups @userPopups() @@ -64,7 +59,7 @@ class App.WidgetOrganization extends App.Controller ### update: (e) => - note = $(e.target).val() + note = $(e.target).ceg({ mode: 'textonly' }) organization = App.Organization.find( @organization_id ) if organization.note isnt note organization.updateAttributes( note: note ) diff --git a/app/assets/javascripts/app/controllers/widget/user.js.coffee b/app/assets/javascripts/app/controllers/widget/user.js.coffee index 5335f1694..d4638a8d5 100644 --- a/app/assets/javascripts/app/controllers/widget/user.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/user.js.coffee @@ -73,16 +73,11 @@ class App.WidgetUser extends App.Controller userData: userData ) - a = => - visible = @el.find('textarea').is(":visible") - if visible && !@el.find('textarea').expanding('active') - @el.find('textarea').expanding() - @el.find('textarea').on('focus', (e) => - visible = @el.find('textarea').is(":visible") - if visible && !@el.find('textarea').expanding('active') - @el.find('textarea').expanding() - ) - @delay( a, 40 ) + @$('div[contenteditable]').ce( + mode: 'textonly' + multiline: true + maxlength: 250 + ) @userTicketPopups( selector: '.user-tickets' @@ -90,17 +85,8 @@ class App.WidgetUser extends App.Controller position: 'right' ) - ### - if user.organization_id - @el.append('
') - new App.WidgetOrganization( - organization_id: user.organization_id - el: @el.find('.org-info') - ) - ### - update: (e) => - note = $(e.target).val() + note = $(e.target).ceg({ mode: 'textonly' }) user = App.User.find( @user_id ) if user.note isnt note user.updateAttributes( note: note ) diff --git a/app/assets/javascripts/app/views/widget/organization.jst.eco b/app/assets/javascripts/app/views/widget/organization.jst.eco index 8db62d4c8..31e71d058 100644 --- a/app/assets/javascripts/app/views/widget/organization.jst.eco +++ b/app/assets/javascripts/app/views/widget/organization.jst.eco @@ -8,7 +8,7 @@