Skip to content

Commit

Permalink
Fix placeholder focus on ie7/8
Browse files Browse the repository at this point in the history
  • Loading branch information
Nihco2 committed Apr 10, 2014
1 parent 185975c commit 0736795
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions dist/js/generic_autocomplete.js
Expand Up @@ -149,8 +149,7 @@ tetra.controller.register("autocomplete", {
havingSuggestion = !0; havingSuggestion = !0;
break; break;
} }
if (!havingSuggestion) return me._container.removeClass("active"), _(me._menu).empty(), if (!havingSuggestion) return me._container.removeClass("active"), void _(me._menu).empty();

This comment has been minimized.

Copy link
@slyg

slyg Apr 10, 2014

Contributor

Wha, wha, why this 👽 void ?

This comment has been minimized.

Copy link
@redking

redking Apr 10, 2014

I've seen this before as an alternative to using 'undefined', because in JavaScript you can redefine the keyword 'undefined' if you want to

This comment has been minimized.

Copy link
@slyg

slyg Apr 10, 2014

Contributor

This line is so so weird I've never seen that before, even the return <expression>, <expression> seems not to be a valid one.

This comment has been minimized.

Copy link
@redking

redking Apr 10, 2014

It'll just return the last expression, I think. But it's a very bad idea to write a return like that.

This comment has been minimized.

Copy link
@tregagnon

tregagnon Apr 10, 2014

Contributor

If I am correct, you can separate expressions using a comma. Some people prefer this condensed syntax.

This comment has been minimized.

Copy link
@slyg

slyg Apr 10, 2014

Contributor

Well, it's a built code, the source is different.

This comment has been minimized.

Copy link
@tregagnon

tregagnon Apr 10, 2014

Contributor

I guess it's OK for minified code. But I have seen some people arguing that the comma is perfectly fine for daily programming. It's a bit like "you don't need semicolons".

This comment has been minimized.

Copy link
@slyg

slyg Apr 10, 2014

Contributor

Right ;) I've read the code without seeing the context, if it's a machine speaking to another machine I'm fine with it.

This comment has been minimized.

Copy link
@redking

redking Apr 10, 2014

I guess void 0 is a semi-useful trick to know, in the rare case when you're afraid that undefined might be redefined by someone. It's not an issue in strict mode by the way, as far as I remember

This comment has been minimized.

Copy link
@thaume

thaume Apr 10, 2014

Contributor

team understanding the code > saving 1 line

void 0;
var suggestions = {}; var suggestions = {};
suggestions.data = suggestionsPack.data.completion, suggestions.query = me._input.val(), suggestions.data = suggestionsPack.data.completion, suggestions.query = me._input.val(),
me._boldifyTerms && (suggestions = me.methods.suggestions.boldify(suggestions)), me._boldifyTerms && (suggestions = me.methods.suggestions.boldify(suggestions)),
Expand Down
4 changes: 2 additions & 2 deletions dist/js/maps.js
Expand Up @@ -46,13 +46,13 @@ tetra.controller.register("api", {
if ("undefined" != typeof params.address) geocoder.geocode({ if ("undefined" != typeof params.address) geocoder.geocode({
address: params.address address: params.address
}, function(results, status) { }, function(results, status) {
return status !== google.maps.GeocoderStatus.OK ? params.cbk(null) : params.cbk(results[0]); return params.cbk(status !== google.maps.GeocoderStatus.OK ? null : results[0]);
}); else if ("undefined" != typeof params.latLng) { }); else if ("undefined" != typeof params.latLng) {
var latlng = new google.maps.LatLng(params.latLng[0], params.latLng[1]); var latlng = new google.maps.LatLng(params.latLng[0], params.latLng[1]);
geocoder.geocode({ geocoder.geocode({
location: latlng location: latlng
}, function(results, status) { }, function(results, status) {
return status !== google.maps.GeocoderStatus.OK ? params.cbk(null) : params.cbk(results[1].formatted_address); return params.cbk(status !== google.maps.GeocoderStatus.OK ? null : results[1].formatted_address);
}); });
} }
} }
Expand Down
2 changes: 1 addition & 1 deletion dist/js/min/generic_autocomplete.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0736795

Please sign in to comment.