mirror of https://github.com/abpframework/abp.git
6 changed files with 36 additions and 15 deletions
@ -0,0 +1,13 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace Volo.CmsKit.Web.Pages.CmsKit.Shared.Components.ReactionSelection |
|||
{ |
|||
public class ReactionSelectionStyleBundleContributor : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/Pages/CmsKit/Shared/Components/ReactionSelection/default.css"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
.cms-reaction-icon |
|||
{ |
|||
cursor: pointer; |
|||
} |
|||
.cms-reaction-icon-selected |
|||
{ |
|||
border: 1px solid gray; |
|||
} |
|||
@ -1,23 +1,25 @@ |
|||
(function () { |
|||
$(document).ready(function () { |
|||
|
|||
function initReactionSelection(){ |
|||
var $this = $(this); |
|||
var $availableReactions = $this.find('.cms-reaction-selection-available-reactions'); |
|||
function initReactionSelection() { |
|||
var $wrapper = $(this); |
|||
var $availableReactions = $wrapper.find('.cms-reaction-selection-available-reactions'); |
|||
|
|||
$availableReactions.find('.cms-reaction-icon').each(function(){ |
|||
$wrapper.find('.cms-reaction-icon').each(function () { |
|||
var $icon = $(this); |
|||
$icon.click(function(){ |
|||
volo.cmsKit.reactions.reactionPublic.create({ |
|||
entityType: $this.attr('data-entity-type'), |
|||
entityId: $this.attr('data-entity-id'), |
|||
$icon.click(function () { |
|||
var methodName = $icon.hasClass('cms-reaction-icon-selected') ? 'delete' : 'create'; |
|||
volo.cmsKit.reactions.reactionPublic[methodName]({ |
|||
entityType: $wrapper.attr('data-entity-type'), |
|||
entityId: $wrapper.attr('data-entity-id'), |
|||
reactionName: $icon.attr('data-name') |
|||
}).then(function () { |
|||
location.reload(); //TODO: JUST TESTING !!!!!!!!
|
|||
}); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
$('.cms-reaction-selection').each(initReactionSelection); |
|||
|
|||
}); |
|||
})(); |
|||
|
|||
Loading…
Reference in new issue