Comments (4)
from xtform.
If I understand this solution correctly the attribute tooltipTrigger is added to the form and it has the same options as the bootstrap tooltip and your code passes this through so the programmer can set the tooltiptrigger for each form seperatly.
Sounds great.
from xtform.
Great stuff on the hover option for the tooltips, works really nice.
A minor bug I found was that when an error is resolved by the user the tooltip is hidden but it reapears when hovered again. I solved this by replacing 'hide' by 'destroy'.
Also I wanted a css handle for styling the element when the tooltip is placed on an alternative element.
This handle must remain as long as there is an error. I solved it by adding an extra class to the element which is removed when the number of errors is 0.
This resulted in this code:
function redrawErrors() {
if (attrs.xtValidationTooltip != ""){
element.addClass('xt-invalid');
}
if (ngModel.$xtErrors.length === 0 ) {
element.removeClass('xt-invalid');
lastErrors = null;
element.tooltip('destroy');
return;
}
Now I have only 1 bug left that I have not solved yet.
When I have input fields in error with hover tooltips and I reset my form the tooltips are not destroyed and can re-appear when it is not appropriate.
Hope this stuff is usefull. If I find a solution for this last bug I'll post it here.
from xtform.
I change the type of my reset button to "reset" and now I actually get in the reset branch in xtForm.
The I do however get a function is undefined on vm.form.$setUntouched
After some googeling and debugging I found out that $setUntouched is not a function of a form, but a function of each form control.
Removing this line of code seem to have no effect on the workings except ther is no javascript error anymore.
Please correct me if I have drawn the wrong conclusion.
However this does not solve my problem, I still need a way to remove all validation tooltips from the form elements on reset.
from xtform.
Related Issues (20)
- CSS styles required for red borders are not documented HOT 1
- seperate tooltip element HOT 3
- translations HOT 5
- $validators HOT 1
- bower install not working HOT 4
- inline validation doesn't work correctly with dynamic id's HOT 2
- fix code for minification HOT 1
- How to use the pattern type for xtFormValidationInline HOT 2
- xtForm + jasmine
- Custom strategy for validation errors on form load
- it's 2015
- xtForm and UI Bootstrap $apply already in progress HOT 3
- Custom validation support? HOT 8
- Tooltips does not hide when I hit browser back button HOT 2
- Add main file to bower.json
- Problem with the validation
- Tooltips left behind HOT 2
- Does not work with nested ng-form
- Installation documentation incorrect HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xtform.