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

add propertychange handlder ,and structure change #7

Closed
wants to merge 4 commits into from

Conversation

guirong
Copy link

@guirong guirong commented Sep 27, 2012

here is some changes

  1. I added a propertychange listener to handle the placeholder attribute change ,so when the attribute change , we can change the input value imidately
  2. the updateplaceholder function and the createplaceholder function are almost same, and updatePlaceholder doesn't process the form submit for new added input element, so I merge the two function to one
  3. sometimes, I don't wan't use the refresh to process the new input element which added after page loaded,I want a function just attach the new input . so I add "attach" method

in addition, I don't think refresh method has meaning any more, except in the browser don't support properychange event. could you think about it?

@jamesallardice
Copy link
Owner

By the sound of it, you've basically done what I've been meaning to do for a while now! I'll have a proper look through your changes as soon as I get a chance and hopefully we can merge it in. Thanks.

@@ -440,6 +419,7 @@ var Placeholders = (function () {
//Expose public methods
return {
init: init,
refresh: updatePlaceholders
refresh: updatePlaceholders,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updatePlaceholders method no longer exists, so this throws an error.

@ahutchings
Copy link

Just ran into this issue - "updatePlaceholder doesn't process the form submit for new added input element", so +1 for this.

@jamesallardice
Copy link
Owner

@ahutchings I've pushed up a fix for that issue. I'm reluctant to merge in this full pull request due to the fact it contains at least one obvious error. I've been waiting for the opener to get back to me before I'll consider merging. But if you grab the latest version, the new form issue should be solved.

@ahutchings
Copy link

Thanks, your fix is working great!

@jamesallardice
Copy link
Owner

@guirong Please let me know if you are able to go through your pull request and sort out any errors. It's been over a month now so if I don't hear back from you soon I'm going to close this. When I get a chance I may use bits of your code to simplify the library but I'm reluctant to merge this in with obvious errors.

@guirong
Copy link
Author

guirong commented Oct 31, 2012

@jamesallardice sorry for that, I will fix it as soon as possible!

@@ -440,6 +419,7 @@ var Placeholders = (function () {
//Expose public methods
return {
init: init,
refresh: updatePlaceholders
refresh: createPlaceholders,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace "updatePlaceholders" by "createPlaceholders", as the original "updatePlaceholders" method's function has been replaced by createPlaceholders.

@guirong
Copy link
Author

guirong commented Nov 23, 2012

@jamesallardice What's going on?

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.

None yet

4 participants