forked from GNUsocial/gnu-social
Moved location container's buttons inside enabled state
This commit is contained in:
parent
4983564949
commit
aef31280f3
49
js/util.js
49
js/util.js
@ -442,13 +442,24 @@ var SN = { // StatusNet
|
|||||||
NoticeLocationAttach: function() {
|
NoticeLocationAttach: function() {
|
||||||
var NDG = $('#'+SN.C.S.NoticeDataGeo);
|
var NDG = $('#'+SN.C.S.NoticeDataGeo);
|
||||||
if (NDG.length > 0) {
|
if (NDG.length > 0) {
|
||||||
NDG.attr('title', NDG.text());
|
|
||||||
var NLE = $('#notice_data-location_wrap');
|
var NLE = $('#notice_data-location_wrap');
|
||||||
var geocodeURL = NLE.attr('title');
|
var geocodeURL = NLE.attr('title');
|
||||||
|
|
||||||
var S = '<div id="'+SN.C.S.NoticeDataGeoSelected+'" class="'+SN.C.S.Success+'"> <button class="minimize">_</button> <button class="close">×</button></div>';
|
$('label[for=notice_data-geo]').attr('title', NLE.text());
|
||||||
var NDGS = $('#'+SN.C.S.NoticeDataGeoSelected);
|
|
||||||
|
|
||||||
|
if (navigator.geolocation) {
|
||||||
|
NDG.change(function() {
|
||||||
|
NLE.removeAttr('title');
|
||||||
|
|
||||||
|
$.cookie(SN.C.S.NoticeLocationCookieName, $('#'+SN.C.S.NoticeDataGeo).attr('checked'));
|
||||||
|
|
||||||
|
var NLN = $('#'+SN.C.S.NoticeLocationName);
|
||||||
|
if (NLN.length > 0) {
|
||||||
|
NLN.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
var S = '<div id="'+SN.C.S.NoticeDataGeoSelected+'" class="'+SN.C.S.Success+'"/div>';
|
||||||
|
NDGS = $('#'+SN.C.S.NoticeDataGeoSelected);
|
||||||
if (NDGS.length > 0) {
|
if (NDGS.length > 0) {
|
||||||
NDGS.replaceWith(S);
|
NDGS.replaceWith(S);
|
||||||
}
|
}
|
||||||
@ -456,6 +467,15 @@ var SN = { // StatusNet
|
|||||||
$('#'+SN.C.S.FormNotice).append(S);
|
$('#'+SN.C.S.FormNotice).append(S);
|
||||||
}
|
}
|
||||||
NDGS = $('#'+SN.C.S.NoticeDataGeoSelected);
|
NDGS = $('#'+SN.C.S.NoticeDataGeoSelected);
|
||||||
|
NDGS.prepend('<span id="'+SN.C.S.NoticeLocationName+'">Geo</span>');
|
||||||
|
|
||||||
|
NLN = $('#'+SN.C.S.NoticeLocationName);
|
||||||
|
|
||||||
|
if ($('#'+SN.C.S.NoticeDataGeo).attr('checked') === true) {
|
||||||
|
NLN.addClass('processing');
|
||||||
|
$('label[for=notice_data-geo]').addClass('checked');
|
||||||
|
|
||||||
|
NDGS.append('<button class="minimize">_</button> <button class="close">×</button>');
|
||||||
|
|
||||||
$('#'+SN.C.S.NoticeDataGeoSelected+' button.close').click(function(){
|
$('#'+SN.C.S.NoticeDataGeoSelected+' button.close').click(function(){
|
||||||
$('#'+SN.C.S.NoticeDataGeoSelected).remove();
|
$('#'+SN.C.S.NoticeDataGeoSelected).remove();
|
||||||
@ -471,25 +491,6 @@ var SN = { // StatusNet
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (navigator.geolocation) {
|
|
||||||
NLE.change(function() {
|
|
||||||
NLE.removeAttr('title');
|
|
||||||
|
|
||||||
$.cookie(SN.C.S.NoticeLocationCookieName, $('#'+SN.C.S.NoticeDataGeo).attr('checked'));
|
|
||||||
|
|
||||||
var NLN = $('#'+SN.C.S.NoticeLocationName);
|
|
||||||
if (NLN.length > 0) {
|
|
||||||
NLN.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
NDGS.prepend('<span id="'+SN.C.S.NoticeLocationName+'">Geo</span>');
|
|
||||||
NLN = $('#'+SN.C.S.NoticeLocationName);
|
|
||||||
|
|
||||||
if ($('#'+SN.C.S.NoticeDataGeo).attr('checked') === true) {
|
|
||||||
NDGS.show();
|
|
||||||
NLN.addClass('processing');
|
|
||||||
$('label[for=notice_data-geo]').addClass('checked');
|
|
||||||
|
|
||||||
navigator.geolocation.getCurrentPosition(function(position) {
|
navigator.geolocation.getCurrentPosition(function(position) {
|
||||||
$('#'+SN.C.S.NoticeLat).val(position.coords.latitude);
|
$('#'+SN.C.S.NoticeLat).val(position.coords.latitude);
|
||||||
$('#'+SN.C.S.NoticeLon).val(position.coords.longitude);
|
$('#'+SN.C.S.NoticeLon).val(position.coords.longitude);
|
||||||
@ -535,8 +536,8 @@ var SN = { // StatusNet
|
|||||||
});
|
});
|
||||||
|
|
||||||
var cookieVal = $.cookie(SN.C.S.NoticeLocationCookieName);
|
var cookieVal = $.cookie(SN.C.S.NoticeLocationCookieName);
|
||||||
$('#'+SN.C.S.NoticeDataGeo).attr('checked', (cookieVal == null || cookieVal == 'true'));
|
NDG.attr('checked', (cookieVal == null || cookieVal == 'true'));
|
||||||
NLE.change();
|
NDG.change();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user