Skip to content

Commit

Permalink
=
Browse files Browse the repository at this point in the history
  • Loading branch information
Arikaim committed Apr 27, 2024
1 parent 611f665 commit 370afa8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
4 changes: 2 additions & 2 deletions arikaim-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"title": "Arikaim UI",
"name": "arikaim-ui",
"package-type": "library",
"version": "1.4.24",
"version": "1.4.25",
"description": "Arikaim UI library",
"repository": "https://github.com/arikaim/arikaim-ui-library.git",
"files": [
"arikaim-ui-1.4.24.min.js"
"arikaim-ui-1.4.25.min.js"
],
"versions": {
"cdn": {
Expand Down
7 changes: 0 additions & 7 deletions arikaim-ui-1.4.23.min.js

This file was deleted.

7 changes: 7 additions & 0 deletions arikaim-ui-1.4.25.min.js

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions arikaim-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,25 @@ function ArikaimUI() {
});
};

this.preloadImages = function(onLoaded, selector, dataAttr) {
if (isEmpty(selector) == true) {
selector = 'img'
}
if (isEmpty(dataAttr) == true) {
dataAttr = 'data-src'
}

$(selector).each(function(index,element) {
var url = $(element).attr(dataAttr);
if (isEmpty(url) == false) {
self.loadImage(url,function() {
$(element).attr('src',url);
callFunction(onLoaded,element);
});
}
});
};

this.loadImage = function(url, onSuccess, onError) {
var image = new Image();
image.onload = function(image) {
Expand Down

0 comments on commit 370afa8

Please sign in to comment.