Commit 9e1d4bfb authored by Chimo's avatar Chimo

jquery-cookie returns `undefined` as of 1.4.0

when a cookie isn't set.

This fixes a problem where the browser was never asking for location,
and the JSON.parse call was throwing an exception when the geolocation cookie wasn't
present.
parent 29620619
......@@ -1081,12 +1081,12 @@ var SN = { // StatusNet
label.attr('title', label.text());
check.change(function () {
if (check.prop('checked') === true || $.cookie(SN.C.S.NoticeDataGeoCookie) === null) {
if (check.prop('checked') === true || $.cookie(SN.C.S.NoticeDataGeoCookie) === undefined) {
label
.attr('title', NoticeDataGeo_text.ShareDisable)
.addClass('checked');
if ($.cookie(SN.C.S.NoticeDataGeoCookie) === null || $.cookie(SN.C.S.NoticeDataGeoCookie) == 'disabled') {
if ($.cookie(SN.C.S.NoticeDataGeoCookie) === undefined || $.cookie(SN.C.S.NoticeDataGeoCookie) == 'disabled') {
if (navigator.geolocation) {
SN.U.NoticeGeoStatus(form, 'Requesting location from browser...');
navigator.geolocation.getCurrentPosition(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment