refactor note and link editors
This commit is contained in:
@@ -1,21 +1,38 @@
|
||||
/*
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.widget.NoteEditor = new Class({
|
||||
Extends:BootstrapDialog,
|
||||
|
||||
initialize:function (model) {
|
||||
$assert(model, "model can not be null");
|
||||
this._model = model;
|
||||
this.parent($msg("Note"), {
|
||||
cancelButton: true,
|
||||
closeButton: true,
|
||||
acceptButton: true,
|
||||
removeButton: true
|
||||
removeButton: true,
|
||||
onRemoveClickData: {model: this._model}
|
||||
});
|
||||
this.setStyle("500px");
|
||||
this._model = model;
|
||||
this.css({width:"600px"});
|
||||
var panel = this._buildPanel(model);
|
||||
this.setContent(panel);
|
||||
// this.onRemoveClickData = {model: this._model};
|
||||
onRemoveClickData = {data:'hola'};
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
_buildPanel:function (model) {
|
||||
@@ -30,7 +47,8 @@ mindplot.widget.NoteEditor = new Class({
|
||||
var textArea = $('<textarea></textarea>').attr({
|
||||
'placeholder':$msg('WRITE_YOUR_TEXT_HERE'),
|
||||
'required':'true',
|
||||
'autofocus':'autofocus'
|
||||
'autofocus':'autofocus',
|
||||
'class':'form-control'
|
||||
});
|
||||
textArea.css({
|
||||
'width':'100%',
|
||||
@@ -64,35 +82,7 @@ mindplot.widget.NoteEditor = new Class({
|
||||
|
||||
onAcceptClick: function() {
|
||||
$("#noteFormId").submit();
|
||||
},
|
||||
|
||||
onRemoveClick: function(event) {
|
||||
if(event.data.model){
|
||||
window.alert('claudio se la come!!');
|
||||
}
|
||||
this._model.setValue(null);
|
||||
this.close();
|
||||
},
|
||||
|
||||
close:function () {
|
||||
this.parent();
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
Reference in New Issue
Block a user