forked from 0x2620/oxjs
fix event handlers and split panel resize event
This commit is contained in:
parent
3f90e96c3a
commit
da9e5dbb29
27 changed files with 722 additions and 118 deletions
|
|
@ -299,7 +299,7 @@ Ox.ListMap = function(options, self) {
|
|||
})
|
||||
.bindEvent({
|
||||
/*
|
||||
addplace: function(event, data) {
|
||||
addplace: function(data) {
|
||||
that.triggerEvent('addplace', data);
|
||||
},
|
||||
*/
|
||||
|
|
@ -317,9 +317,11 @@ Ox.ListMap = function(options, self) {
|
|||
geocode: function(data) {
|
||||
that.triggerEvent('geocode', data);
|
||||
},
|
||||
/*
|
||||
resize: function() {
|
||||
self.$map.resizeMap(); // fixme: don't need event
|
||||
},
|
||||
*/
|
||||
selectplace: selectPlace
|
||||
});
|
||||
|
||||
|
|
@ -616,11 +618,11 @@ Ox.ListMap = function(options, self) {
|
|||
orientation: 'vertical'
|
||||
})
|
||||
.bindEvent({
|
||||
resize: function(foo, size) {
|
||||
self.$placeTitleName.options({width: size - 48});
|
||||
resize: function(data) {
|
||||
self.$placeTitleName.options({width: data.size - 48});
|
||||
// fixme: pass width through form
|
||||
self.$placeFormItems.forEach(function($item) {
|
||||
$item.options({width: size - 16});
|
||||
$item.options({width: data.size - 16});
|
||||
});
|
||||
}
|
||||
}),
|
||||
|
|
@ -705,18 +707,18 @@ Ox.ListMap = function(options, self) {
|
|||
);
|
||||
}
|
||||
|
||||
function openItem(event, data) {
|
||||
selectItem(event, data);
|
||||
function openItem(data) {
|
||||
selectItem(data);
|
||||
self.$map.zoomToPlace(data.ids[0]);
|
||||
}
|
||||
|
||||
function removeItem(event, data) {
|
||||
function removeItem(data) {
|
||||
var id = data.ids[0];
|
||||
that.triggerEvent('removeplace', {id: id});
|
||||
self.$map.removePlace(id);
|
||||
}
|
||||
|
||||
function selectItem(event, data) {
|
||||
function selectItem(data) {
|
||||
Ox.print('selectItem', data.ids[0])
|
||||
var id = data.ids.length ? data.ids[0] : null;
|
||||
self.$map.options({selected: id});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue