I met the same issue.

Try if this patch can fix the issue.

--- 
ReviewBoard-3.0.14/reviewboard/htdocs/static/rb/js/views/reviewRequestEditorView.js.old
  
   2019-05-16 15:06:34.432177001 +0800
+++ 
ReviewBoard-3.0.14/reviewboard/htdocs/static/rb/js/views/reviewRequestEditorView.js
 
2019-05-16 15:06:52.535691603 +0800
@@ -693,7 +693,7 @@
             $uploadFile.click(this._onUploadFileClicked);

             RB.ReviewRequestActionHook.each(function (hook) {
-                _.each(hook.get('callbacks'), function (selector, handler) 
{
+                _.each(hook.get('callbacks'), function (handler, selector) 
{
                     return _this4.$(selector).click(handler);
                 });
             });




在 2017年6月22日星期四 UTC+8下午3:14:34,Ayush Singhal写道:
>
> Hi,
>
> I have added a button to action bar but call back is not happening, i have 
> followed the example, it throws an error saying RBCallback is not defined:
>
> extension.py:-
>
> from reviewboard.extensions.base import Extension, JSExtension
> from reviewboard.extensions.hooks import (HeaderDropdownActionHook,
>                                           ReviewRequestActionHook)
> class actionJsExtention(JSExtension):
>     model_class = 'RBCallback.Extension'
>
> class navigationHook(Extension):
>
>         # Single entry on review requests, consumed from JavaScript.
>     def initialize(self):
>         ReviewRequestActionHook(self, actions=[
>             {
>                 'id': 'reject-id',
>                 'label': 'Reject',
>                 'url': '#',
>             },
>         ])
>
>
>     js_extensions = [actionJsExtention]
>     js_bundles = {
>         'default': {
>             'source_filenames': (
>                 'js/callback.js',
>             )
>         },
>     }
>
> callback.js:-
>
> window.RBCallback = {};
>
> (function() {
>     console.log('In callback.js');
>     RBCallback.Extension = RB.Extension.extend({
>
>         initialize: function () {
>             console.log('Initializing the extension');
>             var _onRejectActionClicked;
>             RB.Extension.initialize.call(this);
>
>             _onRejectActionClicked = function(){
>                 if (confirm(gettext('Are you sure?'))) {
>                     console.log('Click confirmed');
>                 }
>                 else {
>                     console.log('Not confirmed');
>                 }
>         };
>
>             new RB.ReviewRequestActionHook({
>                 extension: this,
>                 callbacks: {
>                     '#reject-id': _onRejectActionClicked,
>                 }
>             });
>         }
>     });
> })();
>
>

-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/reviewboard/726bc22a-0068-4e8b-abd8-ac07cc735fcc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to