Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
bibliossimo
opacce
Commits
3747a100
Commit
3747a100
authored
Dec 14, 2017
by
Patrick Barroca
😁
Browse files
hotline #68652 : fix filters / osm interaction in jquery 3
parent
62463092
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
6 deletions
+29
-6
VERSIONS_HOTLINE/68652
VERSIONS_HOTLINE/68652
+1
-0
library/ZendAfi/View/Helper/Accueil/Base.php
library/ZendAfi/View/Helper/Accueil/Base.php
+5
-1
library/ZendAfi/View/Helper/Accueil/Library.php
library/ZendAfi/View/Helper/Accueil/Library.php
+4
-0
public/opac/js/renderFilters/ajaxifyFilters.js
public/opac/js/renderFilters/ajaxifyFilters.js
+7
-2
tests/library/ZendAfi/View/Helper/Accueil/LibraryTest.php
tests/library/ZendAfi/View/Helper/Accueil/LibraryTest.php
+11
-2
tests/library/ZendAfi/View/Helper/LibrariesMapTests.php
tests/library/ZendAfi/View/Helper/LibrariesMapTests.php
+1
-1
No files found.
VERSIONS_HOTLINE/68652
0 → 100644
View file @
3747a100
- ticket #68652 : Boite bibliothèque : correction de la disparition de la carte lorsque les filtres sont utilisés
\ No newline at end of file
library/ZendAfi/View/Helper/Accueil/Base.php
View file @
3747a100
...
...
@@ -421,9 +421,13 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac
return
$this
;
}
$opts
=
(
$onLoadComplete
=
$filter_settings
->
getOnLoadComplete
())
?
'{onLoadComplete: function(widget){ '
.
$onLoadComplete
.
' }}'
:
'{}'
;
$instance
->
addOPACScript
(
'renderFilters/ajaxifyFilters.js'
)
->
addJQueryReady
(
'$("#boite_'
.
$this
->
getIdModule
()
.
'").ajaxifyFilters();'
);
->
addJQueryReady
(
'$("#boite_'
.
$this
->
getIdModule
()
.
'").ajaxifyFilters(
'
.
$opts
.
'
);'
);
$filter_settings
->
isDisplayModeList
()
?
$instance
->
addStyleSheet
(
Class_Url
::
baseUrl
()
.
'/public/opac/js/renderFilters/list.css'
)
...
...
library/ZendAfi/View/Helper/Accueil/Library.php
View file @
3747a100
...
...
@@ -243,6 +243,10 @@ class ZendAfi_View_Helper_Accueil_Library extends ZendAfi_View_Helper_Accueil_Ba
->
setFiltersPosition
(
$this
->
preferences
[
'filters_position'
])
->
setIdModule
(
$this
->
id_module
);
if
(
$this
->
preferences
[
'osm_map'
])
$this
->
_filter_settings
->
setOnLoadComplete
(
'if (0 < $(widget).find(".leaflet_osm").length) widget.openStreetMap();'
);
return
$this
->
view
->
filters_Render
(
$this
->
_filter_settings
);
}
...
...
public/opac/js/renderFilters/ajaxifyFilters.js
View file @
3747a100
...
...
@@ -18,8 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
(
function
(
$
)
{
$
.
fn
.
ajaxifyFilters
=
function
()
{
$
.
fn
.
ajaxifyFilters
=
function
(
opts
)
{
var
widget
=
$
(
this
);
var
options
=
undefined
!=
opts
?
opts
:
{};
var
refresh
=
function
(
node
,
event
,
url_attr
)
{
var
url
=
node
.
attr
(
url_attr
);
...
...
@@ -36,7 +38,10 @@
var
onLoadComplete
=
function
()
{
widget
.
ajaxifyFilters
();
if
(
'
onLoadComplete
'
in
options
)
options
.
onLoadComplete
(
widget
);
widget
.
ajaxifyFilters
(
options
);
};
...
...
tests/library/ZendAfi/View/Helper/Accueil/LibraryTest.php
View file @
3747a100
...
...
@@ -318,7 +318,9 @@ class ZendAfi_View_Helper_Accueil_LibraryCustomFieldsDisplayTest extends ZendAfi
$this
->
_generateLibrary
([
'titre'
=>
'My library'
,
'libraries'
=>
'1'
,
'fields'
=>
'custom_field_5;custom_field_7;custom_field_9'
]);
'fields'
=>
'custom_field_5;custom_field_7;custom_field_9'
,
'filters'
=>
'custom_field_5'
,
'osm_map'
=>
'1'
]);
}
...
...
@@ -351,5 +353,12 @@ class ZendAfi_View_Helper_Accueil_LibraryCustomFieldsDisplayTest extends ZendAfi
$this
->
assertNotXPath
(
$this
->
html
,
'//div["fields"]//div[3][@class="field-custom"]'
);
}
/** @test */
public
function
jQueryReadyShouldContainsAjaxifyFilters
()
{
$js
=
Class_ScriptLoader
::
getInstance
()
->
javaScriptsHTML
();
$this
->
assertContains
(
'$("#boite_2").ajaxifyFilters({onLoadComplete: function(widget){ if (0 < $(widget).find(".leaflet_osm").length) widget.openStreetMap(); }});'
,
$js
);
}
}
?>
\ No newline at end of file
tests/library/ZendAfi/View/Helper/LibrariesMapTests.php
View file @
3747a100
...
...
@@ -20,7 +20,7 @@
*/
class
ZendAfi_View_Helper_Accueil_Librar
yTestCase
extends
ViewHelperTestCase
{
class
ZendAfi_View_Helper_Accueil_Librar
iesMapTest
extends
ViewHelperTestCase
{
protected
$_storm_default_to_volatile
=
true
;
public
function
setUp
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment