Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-17352 - Use Backbone.noConflict #11504

Merged
merged 3 commits into from Jan 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CRM/UF/Page/ProfileEditor.php
Expand Up @@ -61,6 +61,7 @@ public static function registerProfileScripts() {
->addScriptFile('civicrm', 'packages/backbone-forms/distribution/adapters/backbone.bootstrap-modal.min.js', 140, 'html-header', FALSE)
->addScriptFile('civicrm', 'packages/backbone-forms/distribution/editors/list.min.js', 140, 'html-header', FALSE)
->addStyleFile('civicrm', 'packages/backbone-forms/distribution/templates/default.css', 140, 'html-header')
->addScript('CRM.BB = Backbone.noConflict();', 300, 'html-header')
->addScriptFile('civicrm', 'packages/jquery/plugins/jstree/jquery.jstree.js', 0, 'html-header', FALSE)
->addStyleFile('civicrm', 'packages/jquery/plugins/jstree/themes/default/style.css', 0, 'html-header')
->addStyleFile('civicrm', 'css/crm.designer.css', 140, 'html-header')
Expand Down
46 changes: 0 additions & 46 deletions CRM/Utils/System/Drupal8.php
Expand Up @@ -207,52 +207,6 @@ public function addHTMLHead($header) {
\Drupal::service('civicrm.page_state')->addHtmlHeader($header);
}

/**
* @inheritDoc
*/
public function addScriptUrl($url, $region) {
static $weight = 0;

switch ($region) {
case 'html-header':
break;

default:
return FALSE;
}

$script = array(
'#tag' => 'script',
'#attributes' => array(
'src' => $url,
),
'#weight' => $weight,
);
$weight++;
\Drupal::service('civicrm.page_state')->addJS($script);
return TRUE;
}

/**
* @inheritDoc
*/
public function addScript($code, $region) {
switch ($region) {
case 'html-header':
break;

default:
return FALSE;
}

$script = array(
'#tag' => 'script',
'#value' => $code,
);
\Drupal::service('civicrm.page_state')->addJS($script);
return TRUE;
}

/**
* @inheritDoc
*/
Expand Down
5 changes: 5 additions & 0 deletions css/crm.designer.css
Expand Up @@ -209,6 +209,11 @@ button#crm-designer-add-custom-set {
margin: 0 2em 0 0;
}

/* Hack for Drupal 8 for some reason was moving it around strange */
.crm-designer-dialog .ui-resizable {
position: absolute;
}

.crm-designer-dialog .disabled .description {
display: none;
}
Expand Down
4 changes: 2 additions & 2 deletions js/crm.backbone.js
@@ -1,4 +1,4 @@
(function($, _) {
(function($, _, Backbone) {
if (!CRM.Backbone) CRM.Backbone = {};

/**
Expand Down Expand Up @@ -569,4 +569,4 @@
model.trigger('error', model, resp, options);
};
};
})(CRM.$, CRM._);
})(CRM.$, CRM._, CRM.BB);
4 changes: 2 additions & 2 deletions js/crm.designerapp.js
@@ -1,4 +1,4 @@
(function ($, _) {
(function ($, _, Backbone) {
$(function () {
/**
* FIXME we depend on this being a global singleton, mainly to facilitate vents
Expand Down Expand Up @@ -30,4 +30,4 @@
});
};
});
})(CRM.$, CRM._);
})(CRM.$, CRM._, CRM.BB);
4 changes: 2 additions & 2 deletions js/view/crm.designer.js
@@ -1,4 +1,4 @@
(function($, _) {
(function($, _, Backbone) {
if (!CRM.Designer) CRM.Designer = {};

/**
Expand Down Expand Up @@ -875,4 +875,4 @@
}
});

})(CRM.$, CRM._);
})(CRM.$, CRM._, CRM.BB);
4 changes: 2 additions & 2 deletions js/view/crm.profile-selector.js
@@ -1,4 +1,4 @@
(function($, _) {
(function($, _, Backbone) {
if (!CRM.ProfileSelector) CRM.ProfileSelector = {};

CRM.ProfileSelector.Option = Backbone.Marionette.ItemView.extend({
Expand Down Expand Up @@ -185,4 +185,4 @@
view.render();
}
});
})(CRM.$, CRM._);
})(CRM.$, CRM._, CRM.BB);