From e3ff1f33d7aa5ab9257425bed965916c12fa09c9 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Mon, 10 Feb 2014 20:21:54 +0000 Subject: [PATCH] Fixed user check in avatar image edit --- static/js/app/views/user/userProfileView.coffee | 12 +++++++----- static/js/app/views/user/userProfileView.js | 12 ++++++------ templates/views/UserProfileView.html | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/static/js/app/views/user/userProfileView.coffee b/static/js/app/views/user/userProfileView.coffee index f9219d7..067f698 100644 --- a/static/js/app/views/user/userProfileView.coffee +++ b/static/js/app/views/user/userProfileView.coffee @@ -17,17 +17,19 @@ define ['app', 'utils', 'moment', 'marionette', 'vent', 'app.lib/editableView', onDomRefresh: -> console.log("UserProfileView: initialize") - @setupImageEditable - el: $("#avatar", @el) - url: "/ajax/upload_avatar_image/" - chooseMessage: "Choose profile image" + $.fn.editable.defaults.mode = "inline" $.fn.editableform.loading = "
" - $.fn.editableform.buttons = "" + "" + $.fn.editableform.buttons = "" + "" #editables if utils.isMe(@model.get("id")) + @setupImageEditable + el: $("#avatar", @el) + url: "/ajax/upload_avatar_image/" + chooseMessage: "Choose profile image" + $("#about", @el).editable mode: "inline" type: "wysiwyg" diff --git a/static/js/app/views/user/userProfileView.js b/static/js/app/views/user/userProfileView.js index 6ed9710..48cdfb1 100644 --- a/static/js/app/views/user/userProfileView.js +++ b/static/js/app/views/user/userProfileView.js @@ -39,15 +39,15 @@ UserProfileView.prototype.onDomRefresh = function() { var _this = this; console.log("UserProfileView: initialize"); - this.setupImageEditable({ - el: $("#avatar", this.el), - url: "/ajax/upload_avatar_image/", - chooseMessage: "Choose profile image" - }); $.fn.editable.defaults.mode = "inline"; $.fn.editableform.loading = "
"; - $.fn.editableform.buttons = "" + ""; + $.fn.editableform.buttons = "" + ""; if (utils.isMe(this.model.get("id"))) { + this.setupImageEditable({ + el: $("#avatar", this.el), + url: "/ajax/upload_avatar_image/", + chooseMessage: "Choose profile image" + }); $("#about", this.el).editable({ mode: "inline", type: "wysiwyg", diff --git a/templates/views/UserProfileView.html b/templates/views/UserProfileView.html index fab4455..5ff71b9 100644 --- a/templates/views/UserProfileView.html +++ b/templates/views/UserProfileView.html @@ -6,7 +6,7 @@