Skip to content

Commit

Permalink
Fix on detecting if template is provided or not in the blapy block
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel committed May 1, 2022
1 parent 9ccc6aa commit 949bdfc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Blapy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
* Blapy : jQuery plugin that helps you to create and manage ajax and single page web applications (SPA) with almost no javascript coding to do it.
*
* -----------------------------------------------------------------------------------------
* @copyright Intersel 2015-2021
* @copyright Intersel 2015-2022
* @fileoverview : Blapy is a jQuery plugin that helps you to create and manage an ajax web application.
* @see {@link https://github.com/intersel/Blapy}
* @author : Emmanuel Podvin - emmanuel.podvin@intersel.fr
* @version : 1.14.0
* @license : donationware - see https://github.com/intersel/Blapy/blob/master/LICENSE
* -----------------------------------------------------------------------------------------
* Modifications :
* - 2022/05/01 - E.Podvin - 1.14.2 - Fix on detecting if template is provided or not in the blapy block
* - 2022/02/11 - E.Podvin - 1.14.1
* - data-blapy-template-init-processdata may contain several functions to be applied on received json data
* - 2021/11/14 - E.Podvin - 1.14.0
Expand Down Expand Up @@ -779,12 +780,13 @@

//if no template defined within the block
if (htmlTplContent
.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g, '')
.replace(/\s{2,}/g, ' ')
.replace(/\t/g, ' ')
.toString().trim()
.replace(/(\r\n|\n|\r)/g, "")
.replace(/(\/\*[^*]*\*\/)|(\/\/[^*]*)/g, '')
.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g, '') == "")
.trim()
== "")
{
//look for partial template file
let tplFile = myContainer.attr("data-blapy-template-file");
Expand Down

0 comments on commit 949bdfc

Please sign in to comment.