make available as OC.Backbone to avoid conflicts

This commit is contained in:
Arthur Schiwon 2015-08-06 12:08:42 +02:00
parent cc4a2a4727
commit 67bb5712e4
2 changed files with 17 additions and 0 deletions

12
core/js/oc-backbone.js Normal file
View File

@ -0,0 +1,12 @@
/*
* Copyright (c) 2015
*
* This file is licensed under the Affero General Public License version 3
* or later.
*
* See the COPYING-README file.
*
*/
if(!_.isUndefined(Backbone)) {
OC.Backbone = Backbone.noConflict();
}

View File

@ -455,6 +455,11 @@ class OC_Util {
$path = OC_Util::generatePath($application, 'vendor', $file);
if (!in_array($path, self::$scripts)) {
self::$scripts[] = $path;
if($file === 'backbone/backbone') {
// makes backbone available as OC.Backbone in order to avoid
// conflicts, because apps (like Mail) may bring own versions
OC_Util::addScript('oc-backbone');
}
}
}