CRM_Core_Action::FOLLOWUP => array(
'name' => ts('Merge'),
'class' => 'merge_tag',
- 'url' => 'javascript:',
'title' => ts('Merge Tag'),
),
);
* override function browse()
*/
function browse($action = NULL, $sort = NULL) {
+ CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
$adminTagSet = FALSE;
if (CRM_Core_Permission::check('administer Tagsets')) {
$adminTagSet = TRUE;
validate: true,
refreshAction: ['next_new', 'submit_savenext'],
cancelButton: '.cancel.form-submit',
- openInline: 'a.button',
+ openInline: 'a.button:not([href="#"])',
onCancel: function(event) {},
onError: function(data) {
var $el = $(this);
// Widgetize the content area
.crmSnippet()
// Open action links in a popup
- .on('click', 'a.button, a.action-item:not(".crm-enable-disable")', function() {
+ .on('click', 'a.button, a.action-item', function() {
+ // only follow real links not javascript buttons
+ if ($(this).attr('href') === '#' || $(this).attr('onclick')) {console.log('bogus', this);
+ return;
+ }
CRM.loadForm($(this).attr('href'), {
- openInline: 'a:not(".crm-enable-disable")'
+ openInline: 'a:not([href="#"])'
}).on('crmFormSuccess', function(e, data) {
// Refresh page when form completes
$('#crm-main-content-wrapper').crmSnippet('refresh');
</div>
{/if}
-<div id="mergeTagDialog">
+<div id="mergeTagDialog" style="display:none;">
{ts}Begin typing name of tag to merge into.{/ts}<br/>
<input type="text" id="tag_name"/>
<input type="hidden" id="tag_name_id" value="">
{literal}
<script type="text/javascript">
cj("#mergeTagDialog").hide( );
-cj( function() {
- cj('.merge_tag').click(function(){
- var row_id = cj(this).closest('tr').attr('id');
- var tagId = row_id.split('-');
+cj( function($) {
+ cj('.merge_tag').click(function(e){
+ var tagId = cj(this).closest('tr').attr('id').split('-');
mergeTag(tagId[1]);
+ return false;
});
});
var fromTag = cj('#tag-' + fromId).children('td.crm-tag-name').text();
cj('#used_for_warning').html('');
- cj("#mergeTagDialog").show( );
cj("#mergeTagDialog").dialog({
title: "Merge tag '" + fromTag + "' into:",
modal: true,
}
});
- cj(this).dialog("close");
- cj(this).dialog("destroy");
+ cj(this).dialog("close");
},
"Cancel": function() {
cj(this).dialog("close");
- cj(this).dialog("destroy");
}
}
});