6 changed files with 172 additions and 16 deletions
Binary file not shown.
Binary file not shown.
@ -1,25 +1,55 @@ |
|||||
var InfoPoint = function (parent) { |
var InfoPoint = function (parent) { |
||||
this.Parent = parent; |
this.Parent = parent; |
||||
|
this.Point = null; |
||||
|
|
||||
this.Startup = function () { |
this.Startup = function () { |
||||
$('.icon-view .icon-col').on('click', this.OnColClick.bind(this)); |
$('.icon-view .icon-col').on('click', this.OnColClick.bind(this)); |
||||
$('#close-info-dialog').on('click', this.HideDialog.bind(this)); |
$('#close-info-dialog').on('click', this.HideDialog.bind(this)); |
||||
$('#dialog-info-point-sure').on('click', this.HideDialog.bind(this)); |
$('#dialog-info-point-sure').on('click', this.OnSureClick.bind(this)); |
||||
$('#dialog-info-point-cancel').on('click', this.HideDialog.bind(this)); |
$('#dialog-info-point-cancel').on('click', this.HideDialog.bind(this)); |
||||
} |
}; |
||||
|
|
||||
this.OnColClick = function (event) { |
this.OnColClick = function (event) { |
||||
$('.icon-view .icon-col').removeClass("active"); |
$('.icon-view .icon-col').removeClass("active"); |
||||
|
|
||||
var label = $(event.target).is('img') ? $(event.target).parent('div') : $(event.target); |
var label = $(event.target).is('img') ? $(event.target).parent('div') : $(event.target); |
||||
label.addClass("active"); |
label.addClass("active"); |
||||
} |
}; |
||||
|
|
||||
this.HideDialog = function () { |
this.HideDialog = function () { |
||||
$('#dialog-info-point').hide(); |
$('#dialog-info-point').hide(); |
||||
} |
$('#map').css('cursor', 'grab'); |
||||
|
this.Parent.isMark = false; |
||||
|
}; |
||||
|
|
||||
this.ShowDialog = function () { |
this.ShowDialog = function (point) { |
||||
|
this.Point = point; |
||||
$('#dialog-info-point').show(); |
$('#dialog-info-point').show(); |
||||
|
$("#title").textbox('setValue', '') |
||||
|
}; |
||||
|
|
||||
|
this.OnSureClick = function () { |
||||
|
this.validation(); |
||||
|
} |
||||
|
|
||||
|
this.validation = function () { |
||||
|
if ($("#title").textbox('getValue').trim() === '') { |
||||
|
alert('请输入标题'); |
||||
|
return |
||||
|
} else { |
||||
|
$.ajax({ |
||||
|
type: "POST", |
||||
|
dataType: 'text', |
||||
|
url: '/Point/Add', |
||||
|
data: { |
||||
|
Title: $("#title").textbox('getValue'), |
||||
|
Icon: $('.icon-view .active').attr('name') |
||||
|
}, |
||||
|
success: function (result) { |
||||
|
this.Parent.AddInfoPoint(this.Point, $("#title").textbox('getValue'), $('.icon-view .active').attr('name'), result); |
||||
|
this.HideDialog(); |
||||
|
}.bind(this) |
||||
|
}); |
||||
|
} |
||||
} |
} |
||||
} |
} |
Loading…
Reference in new issue