Skip to content

Commit

Permalink
Fix for #2
Browse files Browse the repository at this point in the history
- Updated Handlebars
- Updated other core dependencies and removed unnecessary library files
- Caught edge case where nested control views do not have $el
  • Loading branch information
solidgoldpig committed Jan 9, 2016
1 parent 0fb58a5 commit 3199d88
Show file tree
Hide file tree
Showing 108 changed files with 4,352 additions and 170,416 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It is built on top of

### Version

0.1.0
0.1.1

### Getting it

Expand All @@ -29,7 +29,7 @@ or
The minimum to get an app up and running would be to include the following within the html of the single page app sent by the server

// AMD loader
<script src="/lib/require/require-2.1.10.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.22/require.min.js"></script>
<script>
// minimum config
var BauplanConfig = {
Expand Down
20 changes: 10 additions & 10 deletions core.config.0.1.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ define({
"lib/require/require.text-2.0.12"
],
jquery: [
"//code.jquery.com/jquery-1.11.2.min",
"//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min"
"//code.jquery.com/jquery-1.11.3.min",
"//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min"
],
"jquery.cookie": [
"//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min",
Expand All @@ -84,7 +84,7 @@ define({
"lib/jquery.easing/jquery.easing-1.3"
],
"jquery.autocomplete": "lib/jquery.autocomplete/jquery.autocomplete-1.2.9",
"jquery.viewport": "lib/jquery.viewport/jquery.viewport",
"jquery.viewport": "lib/jquery.viewport/jquery.viewport-0.0.0",
lodash: [
"//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.underscore.min",
"lib/lodash/lodash.underscore-2.4.1"
Expand All @@ -94,8 +94,8 @@ define({
"lib/backbone/backbone-1.1.2"
],
handlebars: [
"//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min",
"lib/handlebars/handlebars-1.3.0"
"//cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.amd.min",
"lib/handlebars/handlebars.amd-4.0.5"
],
"socket.io": [
"//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.16/socket.io.min",
Expand All @@ -114,7 +114,7 @@ define({
],
datejs: [
"//cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min",
"lib/datejs/datejs"
"lib/datejs/datejs-1.0.0"
],
numeral: [
"//cdnjs.cloudflare.com/ajax/libs/numeral.js/1.5.3/numeral.min",
Expand All @@ -124,14 +124,14 @@ define({
"lib/markdown/markdown-0.5.0.min"
],
wolsey: "lib/wolsey/wolsey-0.1.1.min",
"handlebars.el": "lib/handlebars.el/handlebars.el-1.0.1.min",
"handlebars.el.form": "lib/handlebars.el.form/handlebars.el.form-1.0.2.min",
"handlebars.moment": "lib/handlebars.moment/handlebars.moment-1.0.3.min",
"handlebars.el": "lib/handlebars.el/handlebars.el-1.0.5.min",
"handlebars.el.form": "lib/handlebars.el.form/handlebars.el.form-1.0.5.min",
"handlebars.moment": "lib/handlebars.moment/handlebars.moment-1.0.4.min",
"handlebars.numeral": "lib/handlebars.numeral/handlebars.numeral-0.1.1.min",
"handlebars.choice": "lib/handlebars.choice/handlebars.choice-1.0.1.min",
"handlebars.filter": "lib/handlebars.filter/handlebars.filter-1.0.1.min",
"handlebars.phrase": "lib/handlebars.phrase/handlebars.phrase-1.0.4.min",
"larynx": "lib/larynx/larynx-1.0.0.min",
"larynx": "lib/larynx/larynx-1.0.1.min",
"objectmaker": "lib/objectmaker/objectmaker"
}
});
1 change: 1 addition & 0 deletions js/bauplan.init.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ define([], function () {
require.config(config);
// Thorax needs _ and Handlebars to exist in the global scope
require(["lodash", "handlebars"], function(_, Handlebars) {
window.Handlebars = Handlebars;
// Load bauplan and then let bauplan load
require(["bauplan"], function (Bauplan) {
Bauplan.namespace("Config");
Expand Down
4 changes: 2 additions & 2 deletions js/bauplan.tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ define(function(require) {
var trackerInstance = new Tracker();

// Attempt to catch unhandled errors and exceptions
(function(win){
/*(function(win){
var callback = null, handler = win.onerror;
win.tryCatch = function (tryFn, catchFn) {
Expand All @@ -598,7 +598,7 @@ define(function(require) {
return handler ? handler.apply(win, arguments) : true;
};
})(window);
})(window);*/

// Register events to track automagickally
jQuery(document).on("mouseover", "a, input[type=submit], button", function () {
Expand Down
8 changes: 4 additions & 4 deletions js/bauplan.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ define([
if (control.name !== "control") {
continue;
}
if (checkmethod) {
if (checkmethod && control.$el) {
var value = control.getValue();
control[checkmethod](value, options);
}
Expand Down Expand Up @@ -352,7 +352,7 @@ define([
}
this.disabled = disable;
// would be better if this triggered a change to the actions view
this.$el.find(this.saveSelector).toggleClass("disabled", disable);
this.$el && this.$el.find(this.saveSelector).toggleClass("disabled", disable);
},
/**
* @method disableForm
Expand Down Expand Up @@ -471,7 +471,7 @@ define([
this.onHandle("error", model, response, options);
// maybe this should be in onHandle
this.hasbeensubmitted = false;
this.$el.find(this.saveSelector).removeClass("submitting");
this.$el && this.$el.find(this.saveSelector).removeClass("submitting");
// make it like onSuccess
/*if (this.errorRoute) {
Bauplan.Router.callRoute(this.errorRoute);
Expand Down Expand Up @@ -546,7 +546,7 @@ define([
this.validateAllControls({update:true});
if (this.hasNoErrors && !this.disabled) {
this.hasbeensubmitted = true;
this.$el.find(this.saveSelector).addClass("submitting");
this.$el && this.$el.find(this.saveSelector).addClass("submitting");
this.saveForm(this.saveOptions, e);
} else {
jQuery(e.target).blur();
Expand Down
Loading

0 comments on commit 3199d88

Please sign in to comment.