Merge branch 'master' of github.com:WoltLab/com.woltlab.wcf.conversation
authorAlexander Ebert <ebert@woltlab.com>
Sun, 22 Jul 2012 21:57:02 +0000 (23:57 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 22 Jul 2012 21:57:02 +0000 (23:57 +0200)
1  2 
files/js/WCF.Conversation.js
templates/conversationList.tpl

index 76861588203602bdbd8df60fbb3259310344496d,86d25ae11d3ca25a3dcb93326ef903e37889add1..93709ad934628a4d2f5a5ded19453e7f5c6e55ca
@@@ -727,3 -727,50 +727,50 @@@ WCF.Conversation.Label.Manager = Class.
                this._dialog.wcfDialog('close');
        }
  });
 -});
+ /**
+  * Provides a flexible conversation preview.
+  * 
+  * @see       WCF.Popover
+  */
+ WCF.Conversation.Preview = WCF.Popover.extend({
+       /**
+        * action proxy
+        * @var WCF.Action.Proxy
+        */
+       _proxy: null,
+       
+       /**
+        * @see WCF.Popover.init()
+        */
+       init: function() {
+               this._super('.conversationLink');
+               
+               // init proxy
+               this._proxy = new WCF.Action.Proxy({
+                       showLoadingOverlay: false
+               });
+               
+               WCF.DOMNodeInsertedHandler.addCallback('WCF.Conversation.Preview', $.proxy(this._initContainers, this));
+       },
+       
+       /**
+        * @see WCF.Popover._loadContent()
+        */
+       _loadContent: function() {
+               var $link = $('#' + this._activeElementID);
+               
+               this._proxy.setOption('data', {
+                       actionName: 'getMessagePreview',
+                       className: 'wcf\\data\\conversation\\ConversationAction',
+                       objectIDs: [ $link.data('conversationID') ]
+               });
+               
+               var $elementID = this._activeElementID;
+               var self = this;
+               this._proxy.setOption('success', function(data, textStatus, jqXHR) {
+                       self._insertContent($elementID, data.returnValues.template, true);
+               });
+               this._proxy.sendRequest();
+       }
++});
Simple merge