Thanks, but this just postponed the error message to the next line:
'contentOptions' is not defined.

However, since I cannot refactor 'showContent' (there is stuff
*before* and *after* the relevant properties so I guess previous()
could not apply to it),
I've ended up with implement to both the methods.

On 30 Giu, 23:13, Arian Stolwijk <[email protected]> wrote:
> maybe you should pass the link argument into the original method.
>
> this.previous(link);
>
>
>
>
>
>
>
> On Thu, Jun 30, 2011 at 11:03 PM, 3dolab <[email protected]> wrote:
> > Hello, I've just discovered the powerful refactor method and I'm
> > already stuck!
>
> > I'm trying to implement the "Multibox plugin" in order to make it
> > handle AJAX requests in WordPress through the recommended admin-
> > ajax.php gateway.
>
> > Basically, I first need to add another property (namely 'wpajax') to
> > the 'setContentType' options retrieved from the link rel attribute.
> >https://github.com/samuelbirch/MultiBox/blob/master/Source/MultiBox.j...
> > but my attempt with:
>
> > MultiBox = Class.refactor(MultiBox, {
> >    setContentType: function(link){
> >        this.previous(); //energy++!
> >        if(contentOptions.wpajax){
> >                this.type = 'wpajax';
> >        }
> >    }
> > });
>
> > throws out a "link is undefined" error.
> > Any suggestion?
>
> > Later I should do the same with 'showContent'
> >https://github.com/samuelbirch/MultiBox/blob/master/Source/MultiBox.j...
> > but there I guess that implement is the only option, since I have to
> > inject into the middle and no previous reference seems affordable.
>
> > I could definitely rewrite everything with implement, or even edit the
> > core file (It's been over a year since the last update), but I'd like
> > to learn about this matter...

Reply via email to