SHARE
    TWEET
    Krenair

    srobo nemesis ticket 2208 patch v2

    Feb 3rd, 2014
    198
    0
    Never
    Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
    Diff 1.47 KB | None | 0 0
    1. commit 63d19b1ee6eeb57a2292d8a2ff4baae306fc73b0
    2. Author: Alex Monk <[email protected]>
    3. Date: Mon Feb 3 09:57:24 2014 -0800
    4. 2208: College refresh should also pick up added/removed members
    5. diff --git a/nemesis/static/js/college.js b/nemesis/static/js/college.js
    6. index 3bf5f38..57ce82f 100644
    7. --- a/nemesis/static/js/college.js
    8. +++ b/nemesis/static/js/college.js
    9. @@ -36,13 +36,19 @@ var College = function() {
    10. };
    11. this.reload_users = function(callback) {
    12. - var k = this.users.length;
    13. - $.each(this.users, function(i, user) {
    14. - user.fetch(function() {
    15. - k -= 1;
    16. - if (k == 0) {
    17. - callback();
    18. - }
    19. + this.fetch(function(college) {
    20. + var k = college.users.length;
    21. + var editingUserName = $('li.active') && $('li.active').attr('class').split(' ').length && $('li.active').attr('class').split(' ')[1];
    22. + $.each(college.users, function(i, user) {
    23. + user.fetch(function() {
    24. + k -= 1;
    25. + if (k == 0) {
    26. + if ($('#data-edit-user:visible') && editingUserName == user.username) {
    27. + ev.hide();
    28. + }
    29. + callback();
    30. + }
    31. + });
    32. });
    33. });
    34. };
    Advertisement
    Add Comment
    Please, Sign In to add comment
    Public Pastes
    We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
    Not a member of Pastebin yet?
    Sign Up, it unlocks many cool features!

    AltStyle によって変換されたページ (->オリジナル) /