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

Added new default tag attributes defaulting architecture #667

Merged
merged 2 commits into from May 23, 2015

Conversation

ksevksev
Copy link

I added new default tag attributes defaulting architecture. It includes a new defaultTagAttributes property added to the taOptions object. When coding new defaults for an HTML tag, you:

  1. add an object to taOptions.defaultTagAttributes as a new attribute that has the same name as the HTML attribute and includes attributes with names corresponding to the HTML tag attributes you're defaulting. The values for these attributes are the default value for the corresponding attributes.

For example: ...
defaultTagAttributes : {
a: {target:""}
},
...

means that when 'a' tags are put into the document they will be defaulted with a target value of "".

  1. Alter the code that deals with that tag to use the defaults (or overridden defaults) found in the editor scope defaultTagAttributes property.

Users can override these defaults by passing a similar object to the textAngular (text-angular) directive as the taDefaultTagAttributes (ta-default-tag-attributes) attribute. This attribute extends the taOptions.defaultTagAttributes value that is then used when creating tags.

Ken Severn added 2 commits April 27, 2015 15:14
Implemented 'a' tag target attribute default
taOptions.defaultTagAttributes property. I also added a TODO statement to update this
to use angular.merge as soon as textAngular requires angular 1.4 or higher
@ksevksev
Copy link
Author

Updating the code to use angular.merge will improve the functionality of this feature allowing users to override tag defaults on an individual attribute level, rather than on a tag level.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 2c8c2c9 on ksevksev:master into 7ee680d on fraywing:master.

@ksevksev
Copy link
Author

This is my first github pull request, so please assume so if something is out of order. Just let me know and I'll make the necessary adjustments. Speaking of which, I committed all changed files, which includes generated files (textAngular.js, & minified files, etc.). Please inform me if I need to commit differently, so that you only get the actual 'source' code changes. Thanks! Ken

@SimeonC SimeonC merged commit 2c8c2c9 into textAngular:master May 23, 2015
SimeonC pushed a commit that referenced this pull request May 23, 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.

None yet

3 participants