• Jump To … +
    breakpoints.js date-parse.js jquery.breakpoints.js jquery.calcRestrainedPos.js jquery.clientRect.js jquery.contentSize.js jquery.cookies.js jquery.css.js jquery.customEvent.js jquery.delimitedString.js jquery.disableEvent.js jquery.hostIframe.js jquery.hoverDelay.js jquery.htmlEncode.js jquery.imageSize.js jquery.isVisibleKeyCode.js jquery.menu.js jquery-menu-exampleskin.js jquery.modalDialog.deviceFixes.js jquery.modalDialog.getSettings.js jquery.modalDialog.header.js jquery.modalDialog.history.js jquery.modalDialog.js jquery.modalDialog.unobtrusive.js jquery.modalDialog.userAgent.js jquery.modalDialogContent.header.js jquery.modalDialogContent.js jquery.msAjax.js jquery.ns.js jquery.partialLoad.js jquery.postMessage.js jquery.proxyAll.js jquery.queryString.js jquery.richTooltip.js jquery.scrollAnchor.js jquery.uncomment.js jquery.url.js pointy.gestures.js pointy.js
  • jquery.proxyAll.js

  • ¶
    (function ($) {
  • ¶

    Given an object, will bind its methods’ context to the object using $.proxy()

        $.proxyAll = function (obj, methods) {
  • ¶

    If no methods are specified, use all properties of obj that are functions

            if (!methods) {
                methods = [];
                for (var prop in obj) {
                    if (typeof obj[prop] == "function") {
                        methods.push(prop);
                    }
                }
            }
  • ¶

    If methods is not an array, parse arguments as a param array

            else if (!$.isArray(methods)) {
                methods = Array.prototype.slice.call(arguments, 1);
            }
  • ¶

    Create a bound proxy function for specified methods on obj

            $.each(methods, function (i, method) {
                obj[method] = $.proxy(obj[method], obj);
            });
        };
    
    })(jQuery);