Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

7324 map draft not initialising #84

Merged
merged 3 commits into from
Jun 3, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog - FeedHenry Javascript SDK

## 2.0.25-alpha - 2014-05-29 - IR228 - Wei Li
## 2.0.26-alpha - 2014-05-29 - IR228 - Niall Donnelly

* 7324 - Fixed map rendering and checkboxed from drafts.
* 7093 - Removed for description from the form display.

## 2.0.25-alpha - 2014-05-29 - IR228 - Niall Donnelly

* 7301 - Fixed forms rules engine and preview rendering

114 changes: 1 addition & 113 deletions libs/generated/lawnchair.js
Original file line number Diff line number Diff line change
@@ -1123,116 +1123,4 @@ Lawnchair.adapter('memory', (function(){
}
}
/////
})());
Lawnchair.adapter('titanium', (function(global){

return {
// boolean; true if the adapter is valid for the current environment
valid: function() {
return typeof Titanium !== 'undefined';
},

// constructor call and callback. 'name' is the most common option
init: function( options, callback ) {
if (callback){
return this.fn('init', callback).call(this)
}
},

// returns all the keys in the store
keys: function( callback ) {
if (callback) {
return this.fn('keys', callback).call(this, Titanium.App.Properties.listProperties());
}
return this;
},

// save an object
save: function( obj, callback ) {
var saveRes = Titanium.App.Properties.setObject(obj.key, obj);
if (callback) {
return this.fn('save', callback).call(this, saveRes);
}
return this;
},

// batch save array of objs
batch: function( objs, callback ) {
var me = this;
var saved = [];
for ( var i = 0, il = objs.length; i < il; i++ ) {
me.save( objs[i], function( obj ) {
saved.push( obj );
if ( saved.length === il && callback ) {
me.lambda( callback ).call( me, saved );
}
});
}
return this;
},

// retrieve obj (or array of objs) and apply callback to each
get: function( key /* or array */, callback ) {
var me = this;
if ( this.isArray( key ) ) {
var values = [];
for ( var i = 0, il = key.length; i < il; i++ ) {
me.get( key[i], function( result ) {
if ( result ) values.push( result );
if ( values.length === il && callback ) {
me.lambda( callback ).call( me, values );
}
});
}
} else {
return this.fn('init', callback).call(this, Titanium.App.Properties.getObject(key));
}
return this;
},

// check if an obj exists in the collection
exists: function( key, callback ) {
if (callback){
if (Titanium.App.Properties.getObject(key)){
return callback(this, true);
}else{
return callback(this, false);
}
}

return this;
},

// returns all the objs to the callback as an array
all: function( callback ) {
var me = this;
if ( callback ) {
this.keys(function( keys ) {
if ( !keys.length ) {
me.fn( me.name, callback ).call( me, [] );
} else {
me.get( keys, function( values ) {
me.fn( me.name, callback ).call( me, values );
});
}
});
}
return this;
},

// remove a doc or collection of em
remove: function( key /* or object */, callback ) {
var me = this;
Titanium.App.Properties.removeProperty(key);
if (callback) {
return this.fn('remove', callback).call(this);
}
return this;
},

// destroy everything
nuke: function( callback ) {
// nah, lets not do that
}
};
}(this)));
})());
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fh-js-sdk",
"version": "2.0.25-alpha",
"version": "2.0.26-alpha",
"description": "feedhenry js sdk",
"main": "feedhenry.js",
"browser": {
3 changes: 2 additions & 1 deletion src/appforms/src/backbone/040-view02field01field.js
Original file line number Diff line number Diff line change
@@ -168,7 +168,7 @@ var FieldView = Backbone.View.extend({
this.options.parentEl.append(this.$el);
}

this.show();


// force the element to be initially hidden
if (this.$el.hasClass("hide")) {
@@ -182,6 +182,7 @@ var FieldView = Backbone.View.extend({
self.value(res);
});
}
this.show();
this.checkActionBar();
this.onRender();
},
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ FieldCheckboxView = FieldView.extend({
if (!value || !(value instanceof Array)){
return;
}
for (var i=0; i < value; i++){
for (var i=0; i < value.length; i++){
var v=value[i];
wrapperObj.find("input[value='"+v+"']").attr("checked","checked");
}
7 changes: 7 additions & 0 deletions src/appforms/src/backbone/040-view02field14field_map.js
Original file line number Diff line number Diff line change
@@ -47,10 +47,12 @@ FieldMapView = FieldView.extend({
func = this.allMapInitFunc.shift();
}
}
this.mapResize();
},
onAllMapInit: function(func) {
if (this.mapInited === this.curRepeat) {
func();
this.mapResize();
} else {
if (this.allMapInitFunc.indexOf(func) === -1) {
this.allMapInitFunc.push(func);
@@ -112,6 +114,9 @@ FieldMapView = FieldView.extend({
}
}
},
onRender: function(){
this.mapResize();
},
valueFromElement: function(index) {
var map = this.maps[index];
var marker = this.markers[index];
@@ -130,6 +135,8 @@ FieldMapView = FieldView.extend({
function _handler() {
var map = that.maps[index];
var pt = new google.maps.LatLng(value.lat, value["long"]);
that.mapData[index].lat = value.lat;
that.mapData[index]["long"] = value["long"];
map.setCenter(pt);
map.setZoom(value.zoom);
that.markers[index].setPosition(pt);
6 changes: 1 addition & 5 deletions src/appforms/src/backbone/040-view04Form.js
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ var FormView = BaseView.extend({
templates: {
formLogo: '<div class="fh_appform_logo_container" style="text-align:center;"><div class="fh_appform_logo"></div></div>',
formTitle: '<div class="fh_appform_form_title"><%= title %></div>',
formDescription: '<div class="fh_appform_form_description"><%= description %></div>',
formContainer: '<div id="fh_appform_container" class="fh_appform_form_area fh_appform_container"></div>',
buttons: '<div id="fh_appform_navigation_buttons" class="fh_appform_button_bar"><button class="fh_appform_button_saveDraft fh_appform_hidden fh_appform_button_main fh_appform_button_action">Save Draft</button><button class="fh_appform_button_previous fh_appform_hidden fh_appform_button_default">Previous</button><button class="fh_appform_button_next fh_appform_hidden fh_appform_button_default">Next</button><button class="fh_appform_button_submit fh_appform_hidden fh_appform_button_action">Submit</button></div>'
},
@@ -108,9 +107,6 @@ var FormView = BaseView.extend({
self.$el.find(this.elementNames.formContainer).append(_.template(this.templates.formTitle, {
title: this.model.getName()
}));
self.$el.find(this.elementNames.formContainer).append(_.template(this.templates.formDescription, {
description: this.model.getDescription()
}));

if (!params.submission) {
params.submission = self.model.newSubmission();
@@ -311,7 +307,7 @@ var FormView = BaseView.extend({
render: function() {
this.$el.find("#fh_appform_container.fh_appform_form_area").append(this.templates.buttons);
this.rebindButtons();
this.pageViews[0].$el.removeClass("fh_appform_hidden");
this.pageViews[0].show();
this.pageNum = 0;
this.steps.activePageChange(this);
this.checkRules({