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
Support reusing code in TWBootstrapViewStrategyBase for custom html/css not related to Twitter Bootstrap #168
Comments
Please merge my pull request #169 |
After merging this pull request, following ViewStrategy will work for the desired example: import {TWBootstrapViewStrategyBase} from 'aurelia-validation';
export class TKRViewStrategy extends TWBootstrapViewStrategyBase {
constructor(helpBlockClass: string, formGroupClass: string, validationMsgTagName: string ) {
super(false, true, helpBlockClass, formGroupClass, validationMsgTagName);
}
findExistingHelpBlock(element: Element) {
var helpBlock: Element = <Element>element.lastChild;
if (helpBlock) {
if (!helpBlock.classList) {
return null;
}
else if (!helpBlock.classList.contains(this.helpBlockClass)) {
return null;
}
}
return helpBlock;
}
addHelpBlockToElement(element: Element, helpBlock: Element) {
element.appendChild(helpBlock);
}
} when plugin is configured as follows: .plugin('aurelia-validation', (config: ValidationConfig) => {
config.useViewStrategy(new TKRViewStrategy('custom-validation-msg-class', 'field', 'span'));
}) |
atsu85
pushed a commit
to atsu85/validation
that referenced
this issue
Oct 22, 2015
This includes 3 pull requests in addition to version 0.3.1: 1) aurelia#166 - aurelia#167 - TypeError: Cannot read property 'classList' of null 2) aurelia#168 - aurelia#169 - makes TWBootstrapViewStrategyBase reusable 3) aurelia#170 - aurelia#171 - Improve generated TypeScript declarations
atsu85
pushed a commit
to atsu85/validation
that referenced
this issue
Oct 22, 2015
…le to download custom package with jspm from my repo). This includes 3 pull requests in addition to version 0.3.1: 1) aurelia#166 - aurelia#167 - TypeError: Cannot read property 'classList' of null 2) aurelia#168 - aurelia#169 - makes TWBootstrapViewStrategyBase reusable 3) aurelia#170 - aurelia#171 - Improve generated TypeScript declarations
23 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
I'm not using Twitter Bootstrap, so the html/css for my application needs to differ slightly compared to bootstrap html/css - for example instead of:
I need following layout:
Proposal
To be able to reuse TWBootstrapViewStrategyBase, following changes need to be made in that class:
formGroupClass = "form-group"
validationMsgTagName = "p"
helpBlock
fromfindExistingHelpBlock
helpBlock
fromappendMessageToElement
The text was updated successfully, but these errors were encountered: