Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define $formfield when mediaHandler fires instead of closure #382

Closed
wants to merge 1 commit into from

Conversation

augustuswm
Copy link

cmb.mediaHandlers.* are redefined on the first click of each “file” or “file_list” on the page. Each time .list and .single are redefined the local variables for the current “file” and “file_list” are closed over. This breaks the handlers for any previously clicked “files” and “file_lists”. Variables have been moved into the handlers themselves rather than rewriting the handlers.

It might be more elegant to define new handlers for each "file" or "file_list" that still use the closure over $formfield in particular as opposed to the approach here.

In reference to issues: #250, #296

cmb.mediaHandlers.* are redefined on the first click of each “file” or
“file_list” on the page. Each time .list and .single are redefined the
local variables for the current “file” and “file_list” are closed over.
This breaks the handlers for any previously clicked “files” and
“file_lists”. Variables have been moved into the handlers themselves
rather than rewriting the handlers.

In reference to :CMB2#250,
CMB2#296
@augustuswm
Copy link
Author

Following up to see if there is anything I can do to assist in getting either this fix added or implementing a fix for the issues in another way.

@jtsternberg
Copy link
Member

@augustuswm sounds like you have a good handle on a possible solution. Would you be willing to submit a PR?

@jtsternberg
Copy link
Member

Wow, that's embarrassing.. just realized this IS a PR. ha ha.. I think I have it sorted though.

jtsternberg added a commit that referenced this pull request Aug 6, 2015
@jtsternberg
Copy link
Member

These commits should take care of the issue: 6db15bd...730ef08 (note: I gave you props since you reported and submitted a fix)

@jtsternberg jtsternberg closed this Aug 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants