1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 08:44:46 +02:00

Bump version to 3.0.59 plus a couple other minor updates

This commit is contained in:
Ryan Cramer
2017-04-07 10:14:40 -04:00
parent 00e7a46434
commit 168a4ffa58
4 changed files with 46 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ class ProcessWire extends Wire {
* Reversion revision number
*
*/
const versionRevision = 58;
const versionRevision = 59;
/**
* Version suffix string (when applicable)

View File

@@ -756,6 +756,10 @@ abstract class Wire implements WireTranslatable, WireFuelable, WireTrackable {
* This enables you to add a new accessible property to an existing object, which will execute
* your hook implementation method when called upon.
*
* Note that adding a hook with this just makes it possible to call the hook as a property.
* Any hook property you add can also be called as a method, i.e. `$obj->foo` and `$obj->foo()`
* are the same.
*
* ~~~~~
* // Adding a hook property
* $wire->addHookProperty('Page::lastModifiedStr', function($event) {

View File

@@ -174,6 +174,11 @@ $(document).ready(function() {
*/
}
$(document).on('pageListRefresh', function(e, pageID) {
// i.e. $(document).trigger('pageListRefresh', pageID);
refreshList(pageID);
});
if(options.useHoverActions) {
$root.addClass('PageListUseHoverActions');
setupHoverActions();
@@ -470,8 +475,8 @@ $(document).ready(function() {
* @param jQuery $target Item to attach children to
* @param int start If not starting from first item, num of item to start with
* @param bool beginList Set to true if this is the first call to create the list
* @param bool replace Should any existing list be replaced (true) or appended (false)
* @param bool pagination Set to false if you don't want pagination, otherwise leave it out
* @param bool replace Should any existing list be replaced (true) or appended (false)
*
*/
function loadChildren(id, $target, start, beginList, pagination, replace, callback) {
@@ -975,6 +980,40 @@ $(document).ready(function() {
// console.log(currentOpenPageIDs);
$.cookie('pagelist_open', currentOpenPageIDs);
}
/**
* Force refresh the list that pageID appears in
*
* @param pageID
* @param animate
*
*/
function refreshList(pageID, animate) {
var $parentList = $('.PageListID' + pageID).parent('.PageList');
var $parentItem = $parentList.prev('.PageListItem');
if(!$parentItem.length) return;
var parentID = $parentItem.attr('class').match(/PageListID(\d+)/)[1];
var start = 0;
var $pagination = $parentList.children("ul." + options.paginationClass);
var paginationInfo = $pagination.data('paginationInfo');
var $removeItems = null;
if(paginationInfo) {
var $a = $pagination.find('.pw-link-active');
if($a.length) start = parseInt($a.attr('href')) * paginationInfo.limit;
if(start === NaN) start = 0;
}
if(parentID == 1) {
$removeItems = $parentList.children();
$parentList = $parentItem;
}
$parentList.addClass('PageListForceReload');
loadChildren(parentID, $parentList, start, false, true, true, function() {
if($removeItems && $removeItems.length) $removeItems.remove();
});
}
/**
* Event called when the 'more' action/link is clicked on

File diff suppressed because one or more lines are too long