зеркало из https://github.com/nextcloud/news.git
Break client side plugin API to combat limitations that make it hard to impossible to get the DOM element
This commit is contained in:
Родитель
4b0ec60043
Коммит
1ddbdffdb9
|
@ -1,4 +1,5 @@
|
|||
owncloud-news (5.0.2)
|
||||
owncloud-news (5.1.0)
|
||||
* **Backwards incompatible change**: Break client side plugin API to combat limitations that make it hard to impossible to get the DOM element
|
||||
* **Enhancement**: Expose feed ordering parameter in API
|
||||
|
||||
owncloud-news (5.0.1)
|
||||
|
|
|
@ -2491,12 +2491,14 @@ app.directive('newsArticleActions', function () {
|
|||
'article': '='
|
||||
},
|
||||
replace: true,
|
||||
link: function (scope) {
|
||||
scope.plugins = News.getArticleActionPlugins();
|
||||
scope.pluginClick = function (pluginId, event, article) {
|
||||
News.getArticleActionPluginById(pluginId)
|
||||
.onClick(event, article);
|
||||
};
|
||||
link: function (scope, elem) {
|
||||
var plugins = News.getArticleActionPlugins();
|
||||
scope.plugins = [];
|
||||
|
||||
for (var i=0; i<plugins.length; i+=1) {
|
||||
var plugin = new plugins[i](elem, scope.article);
|
||||
scope.plugins.push(plugin);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -16,12 +16,14 @@ app.directive('newsArticleActions', function () {
|
|||
'article': '='
|
||||
},
|
||||
replace: true,
|
||||
link: function (scope) {
|
||||
scope.plugins = News.getArticleActionPlugins();
|
||||
scope.pluginClick = function (pluginId, event, article) {
|
||||
News.getArticleActionPluginById(pluginId)
|
||||
.onClick(event, article);
|
||||
};
|
||||
link: function (scope, elem) {
|
||||
var plugins = News.getArticleActionPlugins();
|
||||
scope.plugins = [];
|
||||
|
||||
for (var i=0; i<plugins.length; i+=1) {
|
||||
var plugin = new plugins[i](elem, scope.article);
|
||||
scope.plugins.push(plugin);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
|
@ -1,8 +1,6 @@
|
|||
<ul class="article-action-plugins">
|
||||
<li ng-repeat="plugin in ::plugins" class="util"
|
||||
id="article-plugin-{{ plugin.id }}"
|
||||
ng-click="pluginClick(plugin.id, $event, article)"
|
||||
news-stop-propagation>
|
||||
<ul class="article-action-plugins" news-stop-propagation>
|
||||
<li ng-repeat="plugin in ::plugins"
|
||||
class="util article-plugin-{{ plugin.id }}">
|
||||
<button title="{{ plugin.title }}"></button>
|
||||
</li>
|
||||
</ul>
|
Загрузка…
Ссылка в новой задаче