Skip to content

Commit 30a18b4

Browse files
committed
build: release 1.3.0
1 parent cc8c913 commit 30a18b4

13 files changed

+1156
-1845
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Changelog
22

3-
## next
3+
## 1.3.0 (Oct 25, 2018)
44

5+
- Add a new option: `className` (#209).
56
- Fix wrong click action when the target image is ignored by the `filter` option (#211)
67

78
## 1.2.1 (Oct 20, 2018)

README.md

+110-110
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,12 @@ var viewer = new Viewer(document.getElementById('images'));
128128
You may set viewer options with `new Viewer(image, options)`.
129129
If you want to change the global default options, You may use `Viewer.setDefaults(options)`.
130130

131-
### initialViewIndex
132-
133-
- Type: `Number`
134-
- Default: `0`
135-
136-
Define the initial index of image for viewing.
137-
138-
> Also used as the default parameter value of the `view` method.
139-
140-
### inline
131+
### backdrop
141132

142-
- Type: `Boolean`
143-
- Default: `false`
133+
- Type: `Boolean` or `String`
134+
- Default: `true`
144135

145-
Enable inline mode.
136+
Enable a modal backdrop, specify `static` for a backdrop which doesn't close the modal on click.
146137

147138
### button
148139

@@ -227,56 +218,71 @@ toolbar: {
227218
}
228219
```
229220

230-
### tooltip
221+
### className
231222

232-
- Type: `Boolean`
233-
- Default: `true`
223+
- Type: `String`
224+
- Default: `''`
234225

235-
Show the tooltip with image ratio (percentage) when zoom in or zoom out.
226+
Custom class name(s) to add to the viewer's root element.
236227

237-
### movable
228+
### container
238229

239-
- Type: `Boolean`
240-
- Default: `true`
230+
- Type: `Element` or `String`
231+
- Default: `'body'`
232+
- An element or a valid selector for [Document.querySelector](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector)
241233

242-
Enable to move the image.
234+
The container to put the viewer in modal mode.
243235

244-
### zoomable
236+
> Only available when the `inline` option is set to `false`.
245237
246-
- Type: `Boolean`
247-
- Default: `true`
238+
### filter
248239

249-
Enable to zoom the image.
240+
- Type: `Function`
241+
- Default: `null`
250242

251-
### rotatable
243+
Filter the images for viewing (should return `true` if the image is viewable).
252244

253-
- Type: `Boolean`
254-
- Default: `true`
245+
For example:
255246

256-
Enable to rotate the image.
247+
```js
248+
new Viewer(images, {
249+
filter(image) {
250+
return image.complete;
251+
},
252+
});
253+
```
257254

258-
### scalable
255+
### fullscreen
259256

260257
- Type: `Boolean`
261258
- Default: `true`
262259

263-
Enable to scale the image.
260+
Enable to request full screen when play.
264261

265-
### transition
262+
> Requires the browser supports [Full Screen API](http://caniuse.com/fullscreen).
266263
267-
- Type: `Boolean`
268-
- Default: `true`
264+
### initialViewIndex
269265

270-
Enable CSS3 Transition for some special elements.
266+
- Type: `Number`
267+
- Default: `0`
271268

272-
### fullscreen
269+
Define the initial index of image for viewing.
270+
271+
> Also used as the default parameter value of the `view` method.
272+
273+
### inline
273274

274275
- Type: `Boolean`
275-
- Default: `true`
276+
- Default: `false`
276277

277-
Enable to request full screen when play.
278+
Enable inline mode.
278279

279-
> Requires the browser supports [Full Screen API](http://caniuse.com/fullscreen).
280+
### interval
281+
282+
- Type: `Number`
283+
- Default: `5000`
284+
285+
The amount of time to delay between automatically cycling an image when playing.
280286

281287
### keyboard
282288

@@ -285,13 +291,6 @@ Enable to request full screen when play.
285291

286292
Enable keyboard support.
287293

288-
### backdrop
289-
290-
- Type: `Boolean` or `String`
291-
- Default: `true`
292-
293-
Enable a modal backdrop, specify `static` for a backdrop which doesn't close the modal on click.
294-
295294
### loading
296295

297296
- Type: `Boolean`
@@ -308,13 +307,6 @@ Indicate if enable loop viewing or not.
308307

309308
> If the current image is the last one, then the next one to view is the first one, and vice versa.
310309
311-
### interval
312-
313-
- Type: `Number`
314-
- Default: `5000`
315-
316-
The amount of time to delay between automatically cycling an image when playing.
317-
318310
### minWidth
319311

320312
- Type: `Number`
@@ -333,26 +325,58 @@ Define the minimum height of the viewer.
333325

334326
> Only available in inline mode (set the `inline` option to `true`).
335327
336-
### zoomRatio
328+
### movable
337329

338-
- Type: `Number`
339-
- Default: `0.1`
330+
- Type: `Boolean`
331+
- Default: `true`
340332

341-
Define the ratio when zoom the image by wheeling mouse.
333+
Enable to move the image.
342334

343-
### minZoomRatio
335+
### zoomable
344336

345-
- Type: `Number`
346-
- Default: `0.01`
337+
- Type: `Boolean`
338+
- Default: `true`
347339

348-
Define the min ratio of the image when zoom out.
340+
Enable to zoom the image.
349341

350-
### maxZoomRatio
342+
### rotatable
351343

352-
- Type: `Number`
353-
- Default: `100`
344+
- Type: `Boolean`
345+
- Default: `true`
354346

355-
Define the max ratio of the image when zoom in.
347+
Enable to rotate the image.
348+
349+
### scalable
350+
351+
- Type: `Boolean`
352+
- Default: `true`
353+
354+
Enable to scale the image.
355+
356+
### toggleOnDblclick
357+
358+
- Type: `Boolean`
359+
- Default: `true`
360+
361+
Indicate if toggle the image size between its natural size and initial size when double click on the image or not.
362+
363+
In other words, call the [`toggle`](#toggle) method automatically when double click on the image.
364+
365+
> Requires [`dblclick`](https://developer.mozilla.org/en-US/docs/Web/Events/dblclick) event support.
366+
367+
### tooltip
368+
369+
- Type: `Boolean`
370+
- Default: `true`
371+
372+
Show the tooltip with image ratio (percentage) when zoom in or zoom out.
373+
374+
### transition
375+
376+
- Type: `Boolean`
377+
- Default: `true`
378+
379+
Enable CSS3 Transition for some special elements.
356380

357381
### zIndex
358382

@@ -368,6 +392,27 @@ Define the CSS `z-index` value of viewer in modal mode.
368392

369393
Define the CSS `z-index` value of viewer in inline mode.
370394

395+
### zoomRatio
396+
397+
- Type: `Number`
398+
- Default: `0.1`
399+
400+
Define the ratio when zoom the image by wheeling mouse.
401+
402+
### minZoomRatio
403+
404+
- Type: `Number`
405+
- Default: `0.01`
406+
407+
Define the min ratio of the image when zoom out.
408+
409+
### maxZoomRatio
410+
411+
- Type: `Number`
412+
- Default: `100`
413+
414+
Define the max ratio of the image when zoom in.
415+
371416
### url
372417

373418
- Type: `String` or `Function`
@@ -392,51 +437,6 @@ new Viewer(image, {
392437
});
393438
```
394439

395-
### container
396-
397-
- Type: `Element` or `String`
398-
- Default: `'body'`
399-
- An element or a valid selector for [Document.querySelector](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector)
400-
401-
The container to put the viewer in modal mode.
402-
403-
> Only available when the `inline` option is set to `false`.
404-
405-
### className
406-
407-
- Type: `String`
408-
- Default: `''`
409-
410-
Custom class name(s) to add to the viewer's root element.
411-
412-
### filter
413-
414-
- Type: `Function`
415-
- Default: `null`
416-
417-
Filter the images for viewing (should return `true` if the image is viewable).
418-
419-
For example:
420-
421-
```js
422-
new Viewer(images, {
423-
filter(image) {
424-
return image.complete;
425-
},
426-
});
427-
```
428-
429-
### toggleOnDblclick
430-
431-
- Type: `Boolean`
432-
- Default: `true`
433-
434-
Indicate if toggle the image size between its natural size and initial size when double click on the image or not.
435-
436-
In other words, call the [`toggle`](#toggle) method automatically when double click on the image.
437-
438-
> Requires [`dblclick`](https://developer.mozilla.org/en-US/docs/Web/Events/dblclick) event support.
439-
440440
### ready
441441

442442
- Type: `Function`

0 commit comments

Comments
 (0)