fix bugs in page
This commit is contained in:
1 parent
6ed638a1cc
commit
e654fdfea6
387 files changed
+13618
-88879
No files matched your search
@@ -0,0 +1,189 @@
|
||||
// Compiled by ClojureScript 1.9.946 {:static-fns true, :optimize-constants true}
|
||||
goog.provide('reagent.dom');
|
||||
goog.require('cljs.core');
|
||||
goog.require('cljs.core.constants');
|
||||
goog.require('reagent.impl.util');
|
||||
goog.require('reagent.impl.template');
|
||||
goog.require('reagent.impl.batching');
|
||||
goog.require('reagent.ratom');
|
||||
goog.require('reagent.debug');
|
||||
goog.require('reagent.interop');
|
||||
if(typeof reagent.dom.imported !== 'undefined'){
|
||||
} else {
|
||||
reagent.dom.imported = null;
|
||||
}
|
||||
reagent.dom.module = (function reagent$dom$module(){
|
||||
if(!((reagent.dom.imported == null))){
|
||||
return reagent.dom.imported;
|
||||
} else {
|
||||
if(typeof ReactDOM !== 'undefined'){
|
||||
return reagent.dom.imported = ReactDOM;
|
||||
} else {
|
||||
if(typeof require !== 'undefined'){
|
||||
var or__8782__auto__ = reagent.dom.imported = require("react-dom");
|
||||
if(cljs.core.truth_(or__8782__auto__)){
|
||||
return or__8782__auto__;
|
||||
} else {
|
||||
throw (new Error("require('react-dom') failed"));
|
||||
}
|
||||
} else {
|
||||
throw (new Error("js/ReactDOM is missing"));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if(typeof reagent.dom.roots !== 'undefined'){
|
||||
} else {
|
||||
reagent.dom.roots = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
|
||||
}
|
||||
reagent.dom.unmount_comp = (function reagent$dom$unmount_comp(container){
|
||||
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$3(reagent.dom.roots,cljs.core.dissoc,container);
|
||||
|
||||
return (reagent.dom.module()["unmountComponentAtNode"])(container);
|
||||
});
|
||||
reagent.dom.render_comp = (function reagent$dom$render_comp(comp,container,callback){
|
||||
var _STAR_always_update_STAR_14880 = reagent.impl.util._STAR_always_update_STAR_;
|
||||
reagent.impl.util._STAR_always_update_STAR_ = true;
|
||||
|
||||
try{return (reagent.dom.module()["render"])((comp.cljs$core$IFn$_invoke$arity$0 ? comp.cljs$core$IFn$_invoke$arity$0() : comp.call(null)),container,((function (_STAR_always_update_STAR_14880){
|
||||
return (function (){
|
||||
var _STAR_always_update_STAR_14881 = reagent.impl.util._STAR_always_update_STAR_;
|
||||
reagent.impl.util._STAR_always_update_STAR_ = false;
|
||||
|
||||
try{cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(reagent.dom.roots,cljs.core.assoc,container,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [comp,container], null));
|
||||
|
||||
reagent.impl.batching.flush_after_render();
|
||||
|
||||
if(!((callback == null))){
|
||||
return (callback.cljs$core$IFn$_invoke$arity$0 ? callback.cljs$core$IFn$_invoke$arity$0() : callback.call(null));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}finally {reagent.impl.util._STAR_always_update_STAR_ = _STAR_always_update_STAR_14881;
|
||||
}});})(_STAR_always_update_STAR_14880))
|
||||
);
|
||||
}finally {reagent.impl.util._STAR_always_update_STAR_ = _STAR_always_update_STAR_14880;
|
||||
}});
|
||||
reagent.dom.re_render_component = (function reagent$dom$re_render_component(comp,container){
|
||||
return reagent.dom.render_comp(comp,container,null);
|
||||
});
|
||||
/**
|
||||
* Render a Reagent component into the DOM. The first argument may be
|
||||
* either a vector (using Reagent's Hiccup syntax), or a React element. The second argument should be a DOM node.
|
||||
*
|
||||
* Optionally takes a callback that is called when the component is in place.
|
||||
*
|
||||
* Returns the mounted component instance.
|
||||
*/
|
||||
reagent.dom.render = (function reagent$dom$render(var_args){
|
||||
var G__14883 = arguments.length;
|
||||
switch (G__14883) {
|
||||
case 2:
|
||||
return reagent.dom.render.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
|
||||
|
||||
break;
|
||||
case 3:
|
||||
return reagent.dom.render.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
|
||||
|
||||
break;
|
||||
default:
|
||||
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
reagent.dom.render.cljs$core$IFn$_invoke$arity$2 = (function (comp,container){
|
||||
return reagent.dom.render.cljs$core$IFn$_invoke$arity$3(comp,container,null);
|
||||
});
|
||||
|
||||
reagent.dom.render.cljs$core$IFn$_invoke$arity$3 = (function (comp,container,callback){
|
||||
reagent.ratom.flush_BANG_();
|
||||
|
||||
var f = (function (){
|
||||
return reagent.impl.template.as_element(((cljs.core.fn_QMARK_(comp))?(comp.cljs$core$IFn$_invoke$arity$0 ? comp.cljs$core$IFn$_invoke$arity$0() : comp.call(null)):comp));
|
||||
});
|
||||
return reagent.dom.render_comp(f,container,callback);
|
||||
});
|
||||
|
||||
reagent.dom.render.cljs$lang$maxFixedArity = 3;
|
||||
|
||||
reagent.dom.unmount_component_at_node = (function reagent$dom$unmount_component_at_node(container){
|
||||
return reagent.dom.unmount_comp(container);
|
||||
});
|
||||
/**
|
||||
* Returns the root DOM node of a mounted component.
|
||||
*/
|
||||
reagent.dom.dom_node = (function reagent$dom$dom_node(this$){
|
||||
return (reagent.dom.module()["findDOMNode"])(this$);
|
||||
});
|
||||
reagent.impl.template.find_dom_node = reagent.dom.dom_node;
|
||||
/**
|
||||
* Force re-rendering of all mounted Reagent components. This is
|
||||
* probably only useful in a development environment, when you want to
|
||||
* update components in response to some dynamic changes to code.
|
||||
*
|
||||
* Note that force-update-all may not update root components. This
|
||||
* happens if a component 'foo' is mounted with `(render [foo])` (since
|
||||
* functions are passed by value, and not by reference, in
|
||||
* ClojureScript). To get around this you'll have to introduce a layer
|
||||
* of indirection, for example by using `(render [#'foo])` instead.
|
||||
*/
|
||||
reagent.dom.force_update_all = (function reagent$dom$force_update_all(){
|
||||
reagent.ratom.flush_BANG_();
|
||||
|
||||
var seq__14885_14889 = cljs.core.seq(cljs.core.vals(cljs.core.deref(reagent.dom.roots)));
|
||||
var chunk__14886_14890 = null;
|
||||
var count__14887_14891 = (0);
|
||||
var i__14888_14892 = (0);
|
||||
while(true){
|
||||
if((i__14888_14892 < count__14887_14891)){
|
||||
var v_14893 = chunk__14886_14890.cljs$core$IIndexed$_nth$arity$2(null,i__14888_14892);
|
||||
cljs.core.apply.cljs$core$IFn$_invoke$arity$2(reagent.dom.re_render_component,v_14893);
|
||||
|
||||
var G__14894 = seq__14885_14889;
|
||||
var G__14895 = chunk__14886_14890;
|
||||
var G__14896 = count__14887_14891;
|
||||
var G__14897 = (i__14888_14892 + (1));
|
||||
seq__14885_14889 = G__14894;
|
||||
chunk__14886_14890 = G__14895;
|
||||
count__14887_14891 = G__14896;
|
||||
i__14888_14892 = G__14897;
|
||||
continue;
|
||||
} else {
|
||||
var temp__5457__auto___14898 = cljs.core.seq(seq__14885_14889);
|
||||
if(temp__5457__auto___14898){
|
||||
var seq__14885_14899__$1 = temp__5457__auto___14898;
|
||||
if(cljs.core.chunked_seq_QMARK_(seq__14885_14899__$1)){
|
||||
var c__9713__auto___14900 = cljs.core.chunk_first(seq__14885_14899__$1);
|
||||
var G__14901 = cljs.core.chunk_rest(seq__14885_14899__$1);
|
||||
var G__14902 = c__9713__auto___14900;
|
||||
var G__14903 = cljs.core.count(c__9713__auto___14900);
|
||||
var G__14904 = (0);
|
||||
seq__14885_14889 = G__14901;
|
||||
chunk__14886_14890 = G__14902;
|
||||
count__14887_14891 = G__14903;
|
||||
i__14888_14892 = G__14904;
|
||||
continue;
|
||||
} else {
|
||||
var v_14905 = cljs.core.first(seq__14885_14899__$1);
|
||||
cljs.core.apply.cljs$core$IFn$_invoke$arity$2(reagent.dom.re_render_component,v_14905);
|
||||
|
||||
var G__14906 = cljs.core.next(seq__14885_14899__$1);
|
||||
var G__14907 = null;
|
||||
var G__14908 = (0);
|
||||
var G__14909 = (0);
|
||||
seq__14885_14889 = G__14906;
|
||||
chunk__14886_14890 = G__14907;
|
||||
count__14887_14891 = G__14908;
|
||||
i__14888_14892 = G__14909;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return "Updated";
|
||||
});
|
||||
Reference in new issue
Block a user