|
@@ -16,11 +16,21 @@
|
|
|
segment.find('.edit-container').html(_object.editHtml);
|
|
|
initRTEs(segment);
|
|
|
initSegmentMoes(segment);
|
|
|
- segment.removeClass('edit');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function initSegmentMoes(_parent) {
|
|
|
+
|
|
|
+ $('body')
|
|
|
+ .off('mousedown.visit-moe-outside-click')
|
|
|
+ .on('mousedown.visit-moe-outside-click', function (e) {
|
|
|
+ if ($(e.target).closest('[visit-moe]').length) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $('[visit-moe] [url]:not([show])').hide();
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+
|
|
|
_parent.find('[visit-moe] [submit]')
|
|
|
.off('click.visit-moe-submit')
|
|
|
.on('click.visit-moe-submit', function() {
|
|
@@ -49,10 +59,20 @@
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
+ _parent.find('[visit-moe]>a[start]')
|
|
|
+ .off('click.visit-moe-show')
|
|
|
+ .on('click.visit-moe-show', function () {
|
|
|
+ $(this)
|
|
|
+ .closest('[visit-moe]')
|
|
|
+ .find('form[url]')
|
|
|
+ .show();
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+
|
|
|
_parent.find('[visit-moe] [cancel]')
|
|
|
.off('click.visit-moe-cancel')
|
|
|
.on('click.visit-moe-cancel', function() {
|
|
|
- $(this).closest('.note-section').removeClass('edit');
|
|
|
+ $(this).closest('[visit-moe]').find('[url]:not([show])').hide();
|
|
|
return false;
|
|
|
});
|
|
|
}
|