-
Notifications
You must be signed in to change notification settings - Fork 54
Issue 633 - Remove dependency of portal_calendar tool #653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
1b43082
81c3493
93fd065
5f04724
86c4b3d
d7cb92b
40fb5db
bc494bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,61 @@ | ||
| $(function() { | ||
| // override jquery portlet event | ||
| // http://stackoverflow.com/a/14063574/2116850 | ||
| function refreshPortlet(hash, _options){ | ||
| var options = { | ||
| data: {}, | ||
| success: function(){}, | ||
| error: function(){}, | ||
| ajaxOptions: {}}; | ||
| $.extend(options, _options); | ||
| options.data.portlethash = hash; | ||
| ajaxOptions = options.ajaxOptions; | ||
| ajaxOptions.url = $('base').attr('href') + '/@@render-portlet'; | ||
| ajaxOptions.success = function(data){ | ||
| var container = $('[data-portlethash="' + hash + '"]'); | ||
| var portlet = $(data); | ||
| container.html(portlet); | ||
| options.success(data, portlet); | ||
| } | ||
| ajaxOptions.error = function(){ | ||
| options.error(); | ||
| } | ||
| ajaxOptions.data = options.data; | ||
| $.ajax(ajaxOptions); | ||
| } | ||
| $('body').undelegate('#calendar-next, #calendar-previous', 'click') | ||
| .delegate( | ||
| '.portletWrapper #calendar-next, ' + | ||
| '.portletWrapper #calendar-previous', | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this override, I just set the selector to target just portlets with the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rodfersou maybe you can avoid that using a different selector.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hvelarde the problem here is that I am getting the html from the portlet without change, this has the benefit to don't have to maintain this code, but the javascript from this portlet has this problem, the selector to refresh portlet is looking out of the portlet too. It would be no problem if there were a |
||
| 'click', | ||
| function(e) { | ||
| e.preventDefault(); | ||
| var el = $(this); | ||
| var container = el.parents('.portletWrapper'); | ||
| refreshPortlet(container.data('portlethash'), { | ||
| data: { | ||
| month: el.data('month'), | ||
| year: el.data('year') | ||
| } | ||
| }); | ||
| return false; | ||
| }); | ||
| // override jquery portlet event | ||
|
|
||
| $('#content').on( | ||
| 'click', | ||
| '.cover-calendar-tile a.calendar-tile-prev, ' + | ||
| '.cover-calendar-tile a.calendar-tile-next', | ||
| '.cover-calendar-tile .calendarPrevious, ' + | ||
| '.cover-calendar-tile .calendarNext', | ||
| function(e) { | ||
| e.preventDefault(); | ||
| var $a = $(this); | ||
| var $tile = $a.parents('.tile'); | ||
| var url = '@@updatetile' | ||
| if ($a.hasClass('kssCalendarChange')) { | ||
| url = $a.attr('href'); | ||
| } | ||
| $.ajax({ | ||
| url: '@@updatetile', | ||
| url: url, | ||
| data: { | ||
| 'tile-id': $tile.attr('id'), | ||
| 'month:int': $a.attr('data-month'), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rodfersou I think this is a bad idea.
@agnogueira comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hvelarde I don't understand your concern here with this css code.. this selector is restrict to our calendar tile because of the
.cover-calendar-tileclass. It will not affect the portlet calendar.