summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorVidhin Mehta (OpenERP) <vme@tinyerp.com>2012-05-11 17:33:06 +0530
committerVidhin Mehta (OpenERP) <vme@tinyerp.com>2012-05-11 17:33:06 +0530
commit32ecb048dc3daa39573c37144683d3842490dbb2 (patch)
treefd87720b7449d14f36fe2abbeb5d4aca5b917e36 /addons
parentb0a13bff6784fa4b9244dfa68865a53844975ea6 (diff)
[IMP]perfect indentation.
bzr revid: vme@tinyerp.com-20120511120306-j72jwc1mm8kfdsq4
Diffstat (limited to 'addons')
-rw-r--r--addons/event_sale/static/src/js/google_map.js124
1 files changed, 60 insertions, 64 deletions
diff --git a/addons/event_sale/static/src/js/google_map.js b/addons/event_sale/static/src/js/google_map.js
index 179c26069cc..6fe69160447 100644
--- a/addons/event_sale/static/src/js/google_map.js
+++ b/addons/event_sale/static/src/js/google_map.js
@@ -1,68 +1,64 @@
openerp.event = function(instance){
- instance.web.form.widgets.add('geo_address', 'instance.event.GeoAddress');
- instance.event.GeoAddress = instance.web.form.AbstractField.extend(_.extend({}, {
- init : function(){
- this._super.apply(this,arguments);
- this.googleMapsLoaded = $.Deferred();
- },
+ instance.web.form.widgets.add('geo_address', 'instance.event.GeoAddress');
+ instance.event.GeoAddress = instance.web.form.AbstractField.extend(_.extend({}, {
+ init : function(){
+ this._super.apply(this,arguments);
+ this.googleMapsLoaded = $.Deferred();
+ },
+ start:function(){
+ },
- start:function(){
- },
-
- set_input_id:function(id){
- },
- map_load: function() {
- var self = this;
- if(this.googleMapsLoaded.state() != "pending"){return this.googleMapsLoaded.promise();}
- googleMapsCallback = function () {
- self.googleMapsLoaded.resolve();
- };
- $.ajax({
- url: "https://maps.googleapis.com/maps/api/js?v=3&callback=googleMapsCallback&sensor=false",
- dataType: "script"
- }).fail(self.googleMapsLoaded.reject);
- return this.googleMapsLoaded.promise();
- },
- set_value:function(value){
- var self = this;
- this.get_address(value).done(function(value){
- if(!self.__parentedParent.$element.find("#address_text").length)self.__parentedParent.$element.find(".oe_td_border").after(instance.web.qweb.render("address",{'record': value}));
- var address = _.str.sprintf(' %(street)s, %(city)s, %(country_id[1])s', value);
- var defer = self.Map_Load();
- defer.done(function(){
- return self.render_map(address);
- })
- });
-
- },
- get_address:function(value){
- if (!value || value.length == 0){
- return $.Deferred().reject();
- }
- return new instance.web.DataSet (this,this.field.relation, this.build_context()).read_ids(value[0],["street","city","country_id"]);
- },
+ set_input_id:function(id){
+ },
+ map_load: function() {
+ var self = this;
+ if(this.googleMapsLoaded.state() != "pending"){return this.googleMapsLoaded.promise();}
+ googleMapsCallback = function () {
+ self.googleMapsLoaded.resolve();
+ };
+ $.ajax({
+ url: "https://maps.googleapis.com/maps/api/js?v=3&callback=googleMapsCallback&sensor=false",
+ dataType: "script"
+ }).fail(self.googleMapsLoaded.reject);
+ return this.googleMapsLoaded.promise();
+ },
+ set_value:function(value){
+ var self = this;
+ this.get_address(value).done(function(value){
+ if(!self.__parentedParent.$element.find("#address_text").length)self.__parentedParent.$element.find(".oe_td_border").after(instance.web.qweb.render("address",{'record': value}));
+ var address = _.str.sprintf(' %(street)s, %(city)s, %(country_id[1])s', value);
+ var defer = self.Map_Load();
+ defer.done(function(){
+ return self.render_map(address);
+ });
+ });
+ },
+ get_address:function(value){
+ if (!value || value.length == 0){
+ return $.Deferred().reject();
+ }
+ return new instance.web.DataSet (this,this.field.relation, this.build_context()).read_ids(value[0],["street","city","country_id"]);
+ },
- render_map: function(address){
- var geocoder = new google.maps.Geocoder();
- geocoder.geocode( { 'address': address}, function(results, status)
- {
- if (status == google.maps.GeocoderStatus.OK){
- var lat = results[0].geometry.location.lat(),lng =results[0].geometry.location.lng();
- var myOptions = {
- zoom: 17,
- center: new google.maps.LatLng(lat,lng),
- mapTypeId: google.maps.MapTypeId.ROADMAP
- }
- return new google.maps.Marker({
- map : new google.maps.Map(document.getElementById("oe_mapbox"),myOptions),
- position: new google.maps.LatLng(lat,lng)
- });
- }
- });
-
- },
- get_value:function(){
- }
-
- }));
+ render_map: function(address){
+ var geocoder = new google.maps.Geocoder();
+ geocoder.geocode( { 'address': address}, function(results, status){
+ if (status == google.maps.GeocoderStatus.OK){
+ var lat = results[0].geometry.location.lat(),lng =results[0].geometry.location.lng();
+ var myOptions = {
+ zoom: 17,
+ center: new google.maps.LatLng(lat,lng),
+ mapTypeId: google.maps.MapTypeId.ROADMAP
+ }
+ return new google.maps.Marker({
+ map : new google.maps.Map(document.getElementById("oe_mapbox"),myOptions),
+ position: new google.maps.LatLng(lat,lng)
+ });
+ }
+ });
+ },
+ get_value:function(){
+ }
+
+ }));
}; \ No newline at end of file