upload = function upload(file) {
						var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : file.name;

						if (file && file.type.indexOf(type + "/") === 0) {
							_this.mavo.upload(file, path + "/" + name).then(function (url) {
								mainInput.value = url;

								var attempts = 0;

								var checkIfLoaded = Mavo.rr(function () {
									return $.fetch(url + "?" + Date.now()).then(function () {
										_this.mavo.inProgress = false;
										$.fire(mainInput, "input");
									}).catch(function (xhr) {
										if (xhr.status > 400 && attempts < 10) {
											_this.mavo.inProgress = "Loading Image";
											attempts++;
											return Mavo.timeout(2000).then(checkIfLoaded);
										}
									});
								});
							});
						}
					}
Configuration for different types of elements. Options:
- attribute {String}
- useProperty {Boolean}
- datatype {"number"|"boolean"|"string"} Default is "string"
- modes
- editor {Object|Function}
- setEditorValue temporary
- edit
- done
- observe
- default: If there is no attribute, can we use that rule to pick one?
@