Unverified Commit 7942ea78 authored by lauriii's avatar lauriii
Browse files

Issue #3277311 by nod_, Wim Leers, catch, larowlan: Deprecate and mark internal contextual JS API

parent 3f6a61e7
......@@ -132,11 +132,19 @@
contextual.collection.add(model);
// Let other JavaScript react to the adding of a new contextual link.
$(document).trigger('drupalContextualLinkAdded', {
$el: $contextual,
$region,
model,
});
$(document).trigger(
'drupalContextualLinkAdded',
Drupal.deprecatedProperty({
target: {
$el: $contextual,
$region,
model,
},
deprecatedProperty: 'model',
message:
'The model property is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no replacement.',
}),
);
// Fix visual collisions between contextual link triggers.
adjustIfNestedAndOverlapping($contextual);
......@@ -240,6 +248,8 @@
* Namespace for contextual related functionality.
*
* @namespace
*
* @private
*/
Drupal.contextual = {
/**
......@@ -247,6 +257,9 @@
* element of contextual links.
*
* @type {Array}
*
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
* replacement.
*/
views: [],
......@@ -255,6 +268,9 @@
* contextual region element.
*
* @type {Array}
*
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
* replacement.
*/
regionViews: [],
};
......@@ -263,6 +279,9 @@
* A Backbone.Collection of {@link Drupal.contextual.StateModel} instances.
*
* @type {Backbone.Collection}
*
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
* replacement.
*/
Drupal.contextual.collection = new Backbone.Collection([], {
model: Drupal.contextual.StateModel,
......
......@@ -84,11 +84,15 @@
model: model
}, options)));
contextual.collection.add(model);
$(document).trigger('drupalContextualLinkAdded', {
$el: $contextual,
$region: $region,
model: model
});
$(document).trigger('drupalContextualLinkAdded', Drupal.deprecatedProperty({
target: {
$el: $contextual,
$region: $region,
model: model
},
deprecatedProperty: 'model',
message: 'The model property is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no replacement.'
}));
adjustIfNestedAndOverlapping($contextual);
}
......
......@@ -69,12 +69,17 @@
* Namespace for the contextual toolbar.
*
* @namespace
*
* @private
*/
Drupal.contextualToolbar = {
/**
* The {@link Drupal.contextualToolbar.StateModel} instance.
*
* @type {?Drupal.contextualToolbar.StateModel}
*
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is
* no replacement.
*/
model: null,
};
......
......@@ -10,6 +10,9 @@
* @constructor
*
* @augments Backbone.Model
*
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
* replacement.
*/
Drupal.contextual.StateModel = Backbone.Model.extend(
/** @lends Drupal.contextual.StateModel# */ {
......
......@@ -4,6 +4,10 @@
*/
(function (Drupal, Backbone) {
/**
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
* replacement.
*/
Drupal.contextualToolbar.StateModel = Backbone.Model.extend(
/** @lends Drupal.contextualToolbar.StateModel# */ {
/**
......
......@@ -4,6 +4,10 @@
*/
(function ($, Drupal, Backbone, _) {
/**
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
* replacement.
*/
Drupal.contextualToolbar.AuralView = Backbone.View.extend(
/** @lends Drupal.contextualToolbar.AuralView# */ {
/**
......
......@@ -4,6 +4,10 @@
*/
(function (Drupal, Backbone) {
/**
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
* replacement.
*/
Drupal.contextualToolbar.VisualView = Backbone.View.extend(
/** @lends Drupal.contextualToolbar.VisualView# */ {
/**
......
......@@ -4,6 +4,10 @@
*/
(function (Drupal, Backbone) {
/**
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
* replacement.
*/
Drupal.contextual.AuralView = Backbone.View.extend(
/** @lends Drupal.contextual.AuralView# */ {
/**
......
......@@ -4,6 +4,10 @@
*/
(function (Drupal, Backbone) {
/**
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
* replacement.
*/
Drupal.contextual.KeyboardView = Backbone.View.extend(
/** @lends Drupal.contextual.KeyboardView# */ {
/**
......
......@@ -4,6 +4,10 @@
*/
(function (Drupal, Backbone) {
/**
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
* replacement.
*/
Drupal.contextual.RegionView = Backbone.View.extend(
/** @lends Drupal.contextual.RegionView# */ {
/**
......
......@@ -4,6 +4,10 @@
*/
(function (Drupal, Backbone) {
/**
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
* replacement.
*/
Drupal.contextual.VisualView = Backbone.View.extend(
/** @lends Drupal.contextual.VisualView# */ {
/**
......
......@@ -57,6 +57,8 @@ public static function create(ContainerInterface $container) {
* @throws \Symfony\Component\HttpKernel\Exception\BadRequestHttpException
* Thrown when the request contains no ids.
*
* @internal
*
* @see contextual_preprocess()
*/
public function render(Request $request) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment