TimGeyssens / LookWhosEditingToo

Avoid conflicting edits in Umbraco v7
7 stars 6 forks source link

Does not work with Umbraco 7.5.2 #8

Closed DavidVeksler closed 8 years ago

DavidVeksler commented 8 years ago

The plugin does not seem to work:

The edit status does not show and the code inside the code inside "angular.element('#umbracoMainPageBody').scope().$on('$viewContentLoaded', function () {" does not run.

screenshot

DavidVeksler commented 8 years ago

I did a quick and dirty fix with the following patch:

-        angular.element('#umbracoMainPageBody').scope().$on('$viewContentLoaded', function () {
+        angular.element('#umbracoMainPageBody').scope().$on('$includeContentLoaded', function () {

            console.log("init look-whos-editing-too");

                 if ($("#look-whos-editing-too").length == 0) {
-                    $("ng-form[name='contentNameForm']").parent().parent().children(".span5").append("<div id='look-whos-editing-too'></div>");
+                    $("ng-form[name='headerNameForm']").append("<div id='look-whos-editing-too'></div>");
                 }

-                if ($("#look-whos-editing-too-" + edit.userId).length == 0 && currentNodeId == edit.nodeId)
+                if ($("#look-whos-editing-too-" + edit.userId).length == 0 && currentNodeId == edit.nodeId) {
                     $("#look-whos-editing-too").append("<img id='look-whos-editing-too-" + edit.userId + "'src='//www.gravatar.com/avatar/" + edit.userGravatar + ".jpg?s=30&d=mm' title='" + edit.userName + "' >");
+                    $('[key="buttons_saveAndPublish"]').parent().parent().parent().hide();
+                }
+
 div#look-whos-editing-too {
@@ -13,6 +15,11 @@ div#look-whos-editing-too {
     float: right;
     padding-top: 15px;

+    /*#hack todo*/
+    margin: 50px;
+    position: absolute;
+    float: left;
+
 }
TimGeyssens commented 8 years ago

Cool any chance you can provide a pull request for that? That would be ace, thanks :)

DavidVeksler commented 8 years ago

Nevermind - this is fixed in the latest github repo.

florinlazau commented 7 years ago

Hi all,

I am using this awesome tool but I have an issue: I go on a page I don't touch anything (I press save and publish or maybe not) and if I log out and then log in with another user I have the warning that the page is edited by the first user.

Any ideas?

Thanks, Florin