Browse Source

Add edit menu item for owned posts

shortcutme 4 years ago
parent
commit
6c8ac2f81f
2 changed files with 10 additions and 1 deletions
  1. 2 0
      js/Post.coffee
  2. 8 1
      js/all.js

+ 2 - 0
js/Post.coffee

@@ -140,6 +140,8 @@ class Post extends Class
 			@menu.items.push ["Follow in newsfeed", ( => if followed then @unfollow() else @follow() ), followed]
 			@menu.items.push ["Mute user", @user.handleMuteClick]
 			@menu.items.push ["Permalink", @getLink()]
+			if @owned
+				@menu.items.push ["Edit", ( (e) => @editable_body.handleEditClick(e) )]
 			@menu.toggle()
 		return false
 

+ 8 - 1
js/all.js

@@ -4644,6 +4644,13 @@ function clone(obj) {
           ]);
           _this.menu.items.push(["Mute user", _this.user.handleMuteClick]);
           _this.menu.items.push(["Permalink", _this.getLink()]);
+          if (_this.owned) {
+            _this.menu.items.push([
+              "Edit", (function(e) {
+                return _this.editable_body.handleEditClick(e);
+              })
+            ]);
+          }
           return _this.menu.toggle();
         };
       })(this));
@@ -4818,6 +4825,7 @@ function clone(obj) {
 
 }).call(this);
 
+
 /* ---- PostCreate.coffee ---- */
 
 
@@ -6107,7 +6115,6 @@ function clone(obj) {
 
 }).call(this);
 
-
 /* ---- ZeroMe.coffee ---- */