Skip to content

Commit

Permalink
Allow invisible places to be saved via the include_invisible options.
Browse files Browse the repository at this point in the history
  • Loading branch information
atogle committed Jul 9, 2014
1 parent 1d96221 commit b14f5f7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/place-form-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,17 @@ var Shareabouts = Shareabouts || {};
wait: true,
// Explicitly set this. IE9 forgets sometimes.
crossDomain: true,
beforeSend: function ($xhr) {
beforeSend: function ($xhr, options) {
var delim;
// Add custom headers
$xhr.setRequestHeader('X-Shareabouts-Silent', !!self.options.silent);

// Add 'include_invisible' so that we can nicely save invisible places,
// but only if the user says it's okay via the options.
if (self.options.include_invisible) {
delim = options.url.indexOf('?') !== -1 ? '&' : '?';
options.url = options.url + delim + 'include_invisible';
}
},
success: function(evt) {
// Cool, now add it to the collection.
Expand Down

0 comments on commit b14f5f7

Please sign in to comment.