Skip to content

Commit

Permalink
Dev: Trim title for answer-item
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Apr 6, 2016
1 parent be01ae3 commit c10f82d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/survey_runtime.js
Expand Up @@ -587,7 +587,8 @@ function maxlengthtextarea(){
/* add a title on cell with answer */
function doToolTipTable()
{
$(document).on("mouseover"," td.answer-item",function(){
$( this).attr('title',$(this).find("label").text());
$(document).on("mouseover"," td.answer-item",function() {
var text = $(this).find('label').text();
$(this).attr('title', trim(text));
});
}

12 comments on commit c10f82d

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

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

IE8 have issue with trim if i remind : easily fixed with

var text = $(this).find('label').text().trim();

And i think

if(text){
$(this).attr('title', text);
}else{
$(this).removeAttr('title');
}

is better : i can fix if you want

ANd a blame show you why added this function : 66b96a6 ;)

@olleharstedt
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, please do. I prefer

if (text !== '') ...

though.

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

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

OK :)

@LouisGac
Copy link
Contributor

Choose a reason for hiding this comment

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

also IE8 is no more supported by Microsoft, like any version prior to IE11, and Carsten asked us to stop wondering about those unsupported versions :
https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

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

For public part ? I think public IE8 and IE10 min for admin part.

@LouisGac
Copy link
Contributor

Choose a reason for hiding this comment

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

http://www.w3schools.com/browsers/browsers_explorer.asp

Version prior to IE11 represents less than 1% of users.

@LouisGac
Copy link
Contributor

Choose a reason for hiding this comment

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

I've just read this article:
http://www.webdesignerdepot.com/2016/01/ie8-is-back-from-the-dead/

I agree with them : " However, web standards encourage us to develop sites that are stress-tested well below the accepted 1% usage cut-off point. The Web may look a little wonky on IE8, but the content should still be accessible. "

@tpartner
Copy link
Collaborator

@tpartner tpartner commented on c10f82d Apr 7, 2016 via email

Choose a reason for hiding this comment

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

@LouisGac
Copy link
Contributor

Choose a reason for hiding this comment

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

tpartner, yep, they say the same in the article linked above ( http://www.webdesignerdepot.com/2016/01/ie8-is-back-from-the-dead/ )

Stat from CANIUSE:
IE10, 0.87% global usage; IE9, 0.91% global usage; IE8 1.18% global usage; IE7, 0.05% global usage

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi,

$.trim is from jquery utility : doing $(this).text().trim() ; seems clearer for javascript dev than trim($(this).text())
https://api.jquery.com/jQuery.trim/

We earn IE8 compatibility, and maybe other fix form jquery. No ?

@tpartner
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just my 2 cents...I prefer to use it as it's written in the jQuery documentation - $.trim( str ). so in this case $.trim($(this).text())

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

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

for jquery doc : it's to do $.trim(" something ") directly. But .trim is used everywhere on another tools.

Please sign in to comment.