Commit 79c2dc4c authored by webchick's avatar webchick

Issue #2494063 by tohesi, trwad, dcmul, droplet, nod_, naveenvalecha: Update Backbone to 1.2.1

parent 197fa45d
This diff is collapsed.
This diff is collapsed.
......@@ -2,10 +2,10 @@
backbone:
remote: https://github.com/jashkenas/backbone
version: "1.1.2"
version: "1.2.1"
license:
name: MIT
url: https://github.com/jashkenas/backbone/blob/1.1.2/LICENSE
url: https://github.com/jashkenas/backbone/blob/1.2.1/LICENSE
gpl-compatible: true
js:
assets/vendor/backbone/backbone-min.js: { weight: -19, minified: true }
......
......@@ -66,20 +66,17 @@
*/
initialize: function (attrs, options) {
// Respond to new/removed contextual links.
this.listenTo(options.contextualCollection, {
'reset remove add': this.countContextualLinks,
'add': this.lockNewContextualLinks
});
this.listenTo(options.contextualCollection, 'reset remove add', this.countContextualLinks);
this.listenTo(options.contextualCollection, 'add', this.lockNewContextualLinks);
// Automatically determine visibility.
this.listenTo(this, 'change:contextualCount', this.updateVisibility);
this.listenTo(this, {
// Automatically determine visibility.
'change:contextualCount': this.updateVisibility,
// Whenever edit mode is toggled, lock all contextual links.
'change:isViewing': function (model, isViewing) {
options.contextualCollection.each(function (contextualModel) {
contextualModel.set('isLocked', !isViewing);
});
}
// Whenever edit mode is toggled, lock all contextual links.
this.listenTo(this, 'change:isViewing', function (model, isViewing) {
options.contextualCollection.each(function (contextualModel) {
contextualModel.set('isLocked', !isViewing);
});
});
},
......
......@@ -42,11 +42,9 @@
this.changedFieldStates = ['changed', 'saving', 'saved', 'invalid'];
this.readyFieldStates = ['candidate', 'highlighted'];
this.listenTo(options.entitiesCollection, {
// Track app state.
'change:state': this.appStateChange,
'change:isActive': this.enforceSingleActiveEntity
});
// Track app state.
this.listenTo(options.entitiesCollection, 'change:state', this.appStateChange);
this.listenTo(options.entitiesCollection, 'change:isActive', this.enforceSingleActiveEntity);
// Track app state.
this.listenTo(options.fieldsCollection, 'change:state', this.editorStateChange);
......
......@@ -287,8 +287,9 @@ function testVersionQueryString() {
$js = $this->assetResolver->getJsAssets($assets, FALSE)[1];
$js_render_array = \Drupal::service('asset.js.collection_renderer')->render($js);
$rendered_js = $this->renderer->renderPlain($js_render_array);
$this->assertTrue(strpos($rendered_js, 'core/assets/vendor/backbone/backbone-min.js?v=1.1.2') > 0 && strpos($rendered_js, 'core/assets/vendor/domready/ready.min.js?v=1.0.8') > 0 , 'JavaScript version identifiers correctly appended to URLs');
$this->assertTrue(strpos($rendered_js, 'core/assets/vendor/backbone/backbone-min.js?v=1.2.1') > 0 && strpos($rendered_js, 'core/assets/vendor/domready/ready.min.js?v=1.0.8') > 0 , 'JavaScript version identifiers correctly appended to URLs');
}
/**
......
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