Skip to content

Commit

Permalink
updated backbone.localStorage with latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegn committed Feb 16, 2013
1 parent e496a55 commit 974deb8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/backbone.localStorage.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**
* Backbone localStorage Adapter
* Version 1.0
* Version 1.1.0
*
* https://github.com/jeromegn/Backbone.localStorage
*/
(function (root, factory) {
if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
define(["underscore","backbone"], function(_, Backbone) {
// Use global variables if the locals is undefined.
// Use global variables if the locals are undefined.
return factory(_ || root._, Backbone || root.Backbone);
});
} else {
// RequireJS isn't being used. Assume underscore and backbone is loaded in <script> tags
// RequireJS isn't being used. Assume underscore and backbone are loaded in <script> tags
factory(_, Backbone);
}
}(this, function(_, Backbone) {
Expand Down Expand Up @@ -141,6 +141,7 @@ Backbone.LocalStorage.sync = window.Store.sync = Backbone.localSync = function(m
}

if (resp) {
model.trigger("sync", model, resp, options);
if (options && options.success)
if (Backbone.VERSION === "0.9.10") {
options.success(model, resp, options);
Expand All @@ -154,6 +155,7 @@ Backbone.LocalStorage.sync = window.Store.sync = Backbone.localSync = function(m
errorMessage = errorMessage ? errorMessage
: "Record Not Found";

model.trigger("error", model, errorMessage, options);
if (options && options.error)
if (Backbone.VERSION === "0.9.10") {
options.error(model, errorMessage, options);
Expand Down

0 comments on commit 974deb8

Please sign in to comment.