Skip to content

Commit eba4147

Browse files
committed
[refactor] improve background module
1 parent f1f8939 commit eba4147

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

‎src/js/background.js‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ var background = (function(){
22

33
varmod={};
44

5+
mod.import=function(){
6+
// get files from input
7+
varfileList=helper.e(".control-background-image-file").files;
8+
// if file was added
9+
if(fileList.length>0){
10+
// validate the file
11+
_validateImageFile(fileList);
12+
};
13+
};
14+
515
mod.clear={
616
file: function(){
717
helper.setObject({
@@ -159,16 +169,6 @@ var background = (function(){
159169
}
160170
};
161171

162-
varimportData=function(){
163-
// get files from input
164-
varfileList=helper.e(".control-background-image-file").files;
165-
// if file was added
166-
if(fileList.length>0){
167-
// validate the file
168-
_validateImageFile(fileList);
169-
};
170-
};
171-
172172
var_validateImageFile=function(fileList){
173173
// make new file reader
174174
varreader=newFileReader();
@@ -212,9 +212,8 @@ var background = (function(){
212212
return{
213213
init: init,
214214
mod: mod,
215-
bind: bind,
216215
render: render,
217-
importData: importData
216+
bind: bind
218217
};
219218

220219
})();

‎src/js/version.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
varversion=(function(){
22

3-
varcurrent="3.45.0";
3+
varcurrent="3.46.0";
44

55
varcompare=function(a,b){
66
varpa=a.split(".");

‎src/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nightTab",
33
"short_name": "nightTab",
44
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
5-
"version": "3.45.0",
5+
"version": "3.46.0",
66
"manifest_version": 2,
77
"chrome_url_overrides":{
88
"newtab": "index.html"

0 commit comments

Comments
(0)