Suggestion for the right position (center-right+arrow)
Hi, i'm trying to put the prompt+arrow in the right side of an overflow div and after test several ways i get this draft. Though functional in FF and IE (don't tested in others), i know need fix things like:
- It lacks a relation between the arrow and the body of prompt: i.e, click over one must close both (the same for the relation with prompt in other functions like show, hide, etc.).
- In IE the external border and the shadow are superfluos (i was thinking use IE conditional comments but i can't do it works).
- And sure some one else ....
But, even if the arrow part isn't finished, according to i said before; the prompt part seems works ok (overflown or not). And, on the other hand, i guess this way of make the arrows could be extended to the other directions just changing the side no transparent (well, more the positions adjustments; of course). After the ='s line, the snippets. I just add the lines of code between the comments with the title "DRAFT". The [...] represents the code earlier and later of the plugin. I use the name "flecha" (arrow in spanish) for avoid confusion with the original class ("arrow") in the css and i let separate of center-right (tough really are the same position) for the same reason. Ok. That's all. I know this need more work but may be could used as starter for something fully functional (i hope) ... or just for be better the center-right position.
Alejandro
- In showPrompt in jquery.validationEngine.js
[................]
prompt.css({
"top": pos.callerTopPosition, "left": pos.callerleftPosition, "marginTop": pos.marginTopSize, "opacity": 0 }); /***************************** DRAFT ***************************************/ if (options.showArrow && options.promptPosition=="right"){ var flecha = $('').addClass("formError"); flecha.html(''); if (options.isOverflown) prompt.after(flecha) else $("body").append(flecha); var lefty=parseFloat(pos.callerleftPosition)-12; var topy=parseFloat(pos.callerTopPosition)+5; flecha.css({ "left": lefty+'px', "top": topy+'px', "marginTop": pos.marginTopSize
}); } /**_*********************** DRAFT (END) *******************************/ return prompt.animate({ "opacity": 0.87 });}, /** * Updates the prompt text field - the field for which the prompt[.....................]
- In _calculatePosition in jquery.validationEngine.js: [.........................] switch (options.promptPosition) {
default: /**************** DRAFT ********************/ case "right": if (overflow){ promptTopPosition += promptHeight-2; promptleftPosition+= fieldWidth + 20; } else { promptleftPosition+= fieldWidth + 20; } break; /************** DRAFT (END) ***************/ case "topRight": if (overflow)[.................]
- In validationengine.css : [................]
/************************ DRAFT *********************************/ .formError .flecha { border-color: transparent #ee0101 transparent transparent; border-style: solid; border-width: 8px; height:0; width:0; position:absolute; z-index: 5010; } .formError .flecha_borde { border-color: transparent #dddddd transparent transparent ; border-style: solid; border-width: 9px; height:0; width:0; top:-1px; left:-3px; position:absolute; z-index: 5009; } .formError .flecha_borde_externo { border-color: transparent #9b9b9b transparent transparent ; border-style: solid; border-width: 10px; height:0; width:0; top:-2px; left:-6px; position:absolute; z-index: 5008; } .formError .flecha_sombra { border-color: transparent #d2d2d2 transparent transparent ; border-style: solid; border-width: 12px; height:0; width:0; top:-4px; left:-10px; position:absolute; z-index: 5007; } /************************* DRAFT (END) *********************************/[....................]
I see what you are trying to do and I would probably accept a tested patch for it,
but generally if you put your box at center right, the graphic relation between the prompt and the input is stronger and its generally easier to associate the prompt to the correct input,
thats why I didnt try to change the arrow relation for this position
Sorry, i don't understand when you say "to change the arrow relation for this position". Please, could explain me this ?.
posabsolute intentionally didn't add an arrow to the right/left positions because it looks fine this way. the arrows are important when the prompt shows above or bellow the inputs, they help at identifying the source of the error.
However when the prompt shows left or right, they show right next to the field - hence the user doesn't need to be guided as much.
Looking at the code, I understand why Cedric decided to get around it. It brings so much complexity to the code base, that it's probably easier to skip arrows for these positions.
Bottom line, thank you for your contribution, We will gladly accept a pull request assuming it works with every browser and doesn't break the code
Sincerely,
Ok, i get the point. I'll try to pulish the code and if i can improve it enough i'll send you again.
Alejandro
what is the status of this? I need it in my project?